mirror of
https://github.com/NishiOwO/fvwm1.git
synced 2025-04-21 08:44:39 +00:00
27 lines
462 B
C
27 lines
462 B
C
#include <string.h>
|
|
#include "../configure.h"
|
|
|
|
#if HAVE_UNAME
|
|
#include <sys/utsname.h>
|
|
|
|
/* return a string indicating the OS type (i.e. "Linux", "SINIX-D", ... ) */
|
|
int mygetostype(char *buf, int max)
|
|
{
|
|
struct utsname sysname;
|
|
int ret;
|
|
|
|
if ((ret = uname(&sysname)) == -1)
|
|
strcpy (buf,"");
|
|
else
|
|
strncat (strcpy(buf,""), sysname.sysname, max);
|
|
return ret;
|
|
}
|
|
#else
|
|
int mygetostype(char *buf, int max)
|
|
{
|
|
strcpy (buf,"");
|
|
return -1;
|
|
}
|
|
#endif
|
|
|