/* * uname.c - get name and information about current OS * * Stefan Haubenthal, Jul 9 2003 */ #include #include #ifdef __ATARI__ #include #elif __CBM__ #include #endif #include int uname(struct utsname *buf) { #ifdef __APPLE2__ strcpy(buf->sysname, "APPLE2"); #elif __ATARI__ strcpy(buf->sysname, "ATARI"); buf->release[0]=(get_ostype() & AT_OS_TYPE_MAIN) + '0'; buf->release[1]='\0'; buf->version[0]=((get_ostype() & AT_OS_TYPE_MINOR) >> 5)+ '0'; buf->version[1]='\0'; #elif __ATMOS__ strcpy(buf->sysname, "ORIC"); strcpy(buf->machine, "ATMOS"); #elif __CBM__ strcpy(buf->sysname, "CBM"); # ifdef __C16__ strcpy(buf->release, "3"); strcpy(buf->version, "5"); strcpy(buf->machine, "C16"); # elif __C64__ strcpy(buf->release, "2"); strcpy(buf->version, "0"); strcpy(buf->machine, "C64"); # elif __C128__ strcpy(buf->release, "7"); strcpy(buf->version, "0"); strcpy(buf->machine, "C128"); # elif __PLUS4__ strcpy(buf->release, "3"); strcpy(buf->version, "5"); strcpy(buf->machine, "PLUS4"); # elif __CBM510__ strcpy(buf->machine, "CBM510"); # elif __CBM610__ strcpy(buf->machine, "CBM610"); # elif __PET__ strcpy(buf->release, "2"); strcpy(buf->version, "0"); strcpy(buf->machine, "PET"); # endif #elif __GEOS__ strcpy(buf->sysname, "GEOS"); strcpy(buf->machine, "C64"); #else _errno = ENOSYS; return -1; #endif return 0; }