2 #define PERLIO_NOT_STDIO 1
6 #ifdef I_DIRENT /* XXX maybe better to just rely on perl.h? */
29 /* XXX This comment is just to make I_TERMIO and I_SGTTY visible to
30 metaconfig for future extension writers. We don't use them in POSIX.
31 (This is really sneaky :-) --AD
33 #if defined(I_TERMIOS)
41 #include <sys/types.h>
43 #include <unistd.h> /* see hints/sunos_4_1.sh */
46 #if defined(__VMS) && !defined(__POSIX_SOURCE)
47 # include <libdef.h> /* LIB$_INVARG constant */
48 # include <lib$routines.h> /* prototype for lib$ediv() */
49 # include <starlet.h> /* prototype for sys$gettim() */
50 # if DECC_VERSION < 50000000
51 # define pid_t int /* old versions of DECC miss this in types.h */
54 # undef mkfifo /* #defined in perl.h */
55 # define mkfifo(a,b) (not_here("mkfifo"),-1)
56 # define tzset() not_here("tzset")
58 #if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000)
59 # define HAS_TZNAME /* shows up in VMS 7.0 or Dec C 5.6 */
61 # endif /* __VMS_VER >= 70000000 or Dec C 5.6 */
63 /* The POSIX notion of ttyname() is better served by getname() under VMS */
64 static char ttnambuf[64];
65 # define ttyname(fd) (isatty(fd) > 0 ? getname(fd,ttnambuf,0) : NULL)
67 /* The non-POSIX CRTL times() has void return type, so we just get the
68 current time directly */
69 clock_t vms_times(struct tms *bufptr) {
71 /* Get wall time and convert to 10 ms intervals to
72 * produce the return value that the POSIX standard expects */
73 # if defined(__DECC) && defined (__ALPHA)
76 _ckvmssts(sys$gettim(&vmstime));
78 retval = vmstime & 0x7fffffff;
80 /* (Older hw or ccs don't have an atomic 64-bit type, so we
81 * juggle 32-bit ints (and a float) to produce a time_t result
82 * with minimal loss of information.) */
83 long int vmstime[2],remainder,divisor = 100000;
84 _ckvmssts(sys$gettim((unsigned long int *)vmstime));
85 vmstime[1] &= 0x7fff; /* prevent overflow in EDIV */
86 _ckvmssts(lib$ediv(&divisor,vmstime,(long int *)&retval,&remainder));
88 /* Fill in the struct tms using the CRTL routine . . .*/
89 times((tbuffer_t *)bufptr);
90 return (clock_t) retval;
92 # define times(t) vms_times(t)
95 # include <sys/times.h>
97 # include <sys/utsname.h>
99 # include <sys/wait.h>
106 typedef long SysRetLong;
107 typedef sigset_t* POSIX__SigSet;
108 typedef HV* POSIX__SigAction;
110 typedef struct termios* POSIX__Termios;
111 #else /* Define termios types to int, and call not_here for the functions.*/
112 #define POSIX__Termios int
116 #define cfgetispeed(x) not_here("cfgetispeed")
117 #define cfgetospeed(x) not_here("cfgetospeed")
118 #define tcdrain(x) not_here("tcdrain")
119 #define tcflush(x,y) not_here("tcflush")
120 #define tcsendbreak(x,y) not_here("tcsendbreak")
121 #define cfsetispeed(x,y) not_here("cfsetispeed")
122 #define cfsetospeed(x,y) not_here("cfsetospeed")
123 #define ctermid(x) (char *) not_here("ctermid")
124 #define tcflow(x,y) not_here("tcflow")
125 #define tcgetattr(x,y) not_here("tcgetattr")
126 #define tcsetattr(x,y,z) not_here("tcsetattr")
129 /* Possibly needed prototypes */
130 char *cuserid _((char *));
131 double strtod _((const char *, char **));
132 long strtol _((const char *, char **, int));
133 unsigned long strtoul _((const char *, char **, int));
136 #define cuserid(a) (char *) not_here("cuserid")
140 #define difftime(a,b) not_here("difftime")
143 #ifndef HAS_FPATHCONF
144 #define fpathconf(f,n) (SysRetLong) not_here("fpathconf")
147 #define mktime(a) not_here("mktime")
150 #define nice(a) not_here("nice")
153 #define pathconf(f,n) (SysRetLong) not_here("pathconf")
156 #define sysconf(n) (SysRetLong) not_here("sysconf")
159 #define readlink(a,b,c) not_here("readlink")
162 #define setpgid(a,b) not_here("setpgid")
165 #define setsid() not_here("setsid")
168 #define strcoll(s1,s2) not_here("strcoll")
171 #define strtod(s1,s2) not_here("strtod")
174 #define strtol(s1,s2,b) not_here("strtol")
177 #define strtoul(s1,s2,b) not_here("strtoul")
180 #define strxfrm(s1,s2,n) not_here("strxfrm")
182 #ifndef HAS_TCGETPGRP
183 #define tcgetpgrp(a) not_here("tcgetpgrp")
185 #ifndef HAS_TCSETPGRP
186 #define tcsetpgrp(a,b) not_here("tcsetpgrp")
189 #define times(a) not_here("times")
192 #define uname(a) not_here("uname")
195 #define waitpid(a,b,c) not_here("waitpid")
200 #define mblen(a,b) not_here("mblen")
204 #define mbstowcs(s, pwcs, n) not_here("mbstowcs")
207 #define mbtowc(pwc, s, n) not_here("mbtowc")
210 #define wcstombs(s, pwcs, n) not_here("wcstombs")
213 #define wctomb(s, wchar) not_here("wcstombs")
215 #if !defined(HAS_MBLEN) && !defined(HAS_MBSTOWCS) && !defined(HAS_MBTOWC) && !defined(HAS_WCSTOMBS) && !defined(HAS_WCTOMB)
216 /* If we don't have these functions, then we wouldn't have gotten a typedef
217 for wchar_t, the wide character type. Defining wchar_t allows the
218 functions referencing it to compile. Its actual type is then meaningless,
219 since without the above functions, all sections using it end up calling
220 not_here() and croak. --Kaveh Ghazi (ghazi@noc.rutgers.edu) 9/18/94. */
226 #ifndef HAS_LOCALECONV
227 #define localeconv() not_here("localeconv")
231 extern char *tzname[];
233 char *tzname[] = { "" , "" };
236 /* XXX struct tm on some systems (SunOS4/BSD) contains extra (non POSIX)
237 * fields for which we don't have Configure support yet:
238 * char *tm_zone; -- abbreviation of timezone name
239 * long tm_gmtoff; -- offset from GMT in seconds
240 * To workaround core dumps from the uninitialised tm_zone we get the
241 * system to give us a reasonable struct to copy. This fix means that
242 * strftime uses the tm_zone and tm_gmtoff values returned by
243 * localtime(time()). That should give the desired result most of the
244 * time. But probably not always!
246 * This is a temporary workaround to be removed once Configure
247 * support is added and NETaa14816 is considered in full.
248 * It does not address tzname aspects of NETaa14816.
250 #ifdef STRUCT_TM_HASZONE
252 init_tm(ptm) /* see mktime, strftime and asctime */
257 Copy(localtime(&now), ptm, 1, struct tm);
261 # define init_tm(ptm)
265 #ifndef HAS_LONG_DOUBLE /* XXX What to do about long doubles? */
281 croak("POSIX::%s not implemented on this architecture", s);
293 if (strEQ(name, "ARG_MAX"))
301 if (strEQ(name, "BUFSIZ"))
307 if (strEQ(name, "BRKINT"))
313 if (strEQ(name, "B9600"))
319 if (strEQ(name, "B19200"))
325 if (strEQ(name, "B38400"))
331 if (strEQ(name, "B0"))
337 if (strEQ(name, "B110"))
343 if (strEQ(name, "B1200"))
349 if (strEQ(name, "B134"))
355 if (strEQ(name, "B150"))
361 if (strEQ(name, "B1800"))
367 if (strEQ(name, "B200"))
373 if (strEQ(name, "B2400"))
379 if (strEQ(name, "B300"))
385 if (strEQ(name, "B4800"))
391 if (strEQ(name, "B50"))
397 if (strEQ(name, "B600"))
403 if (strEQ(name, "B75"))
411 if (strEQ(name, "CHAR_BIT"))
417 if (strEQ(name, "CHAR_MAX"))
423 if (strEQ(name, "CHAR_MIN"))
429 if (strEQ(name, "CHILD_MAX"))
435 if (strEQ(name, "CLK_TCK"))
441 if (strEQ(name, "CLOCAL"))
447 if (strEQ(name, "CLOCKS_PER_SEC"))
448 #ifdef CLOCKS_PER_SEC
449 return CLOCKS_PER_SEC;
453 if (strEQ(name, "CREAD"))
459 if (strEQ(name, "CS5"))
465 if (strEQ(name, "CS6"))
471 if (strEQ(name, "CS7"))
477 if (strEQ(name, "CS8"))
483 if (strEQ(name, "CSIZE"))
489 if (strEQ(name, "CSTOPB"))
497 if (strEQ(name, "DBL_MAX"))
503 if (strEQ(name, "DBL_MIN"))
509 if (strEQ(name, "DBL_DIG"))
515 if (strEQ(name, "DBL_EPSILON"))
521 if (strEQ(name, "DBL_MANT_DIG"))
527 if (strEQ(name, "DBL_MAX_10_EXP"))
528 #ifdef DBL_MAX_10_EXP
529 return DBL_MAX_10_EXP;
533 if (strEQ(name, "DBL_MAX_EXP"))
539 if (strEQ(name, "DBL_MIN_10_EXP"))
540 #ifdef DBL_MIN_10_EXP
541 return DBL_MIN_10_EXP;
545 if (strEQ(name, "DBL_MIN_EXP"))
555 if (strEQ(name, "EACCES"))
561 if (strEQ(name, "EADDRINUSE"))
567 if (strEQ(name, "EADDRNOTAVAIL"))
569 return EADDRNOTAVAIL;
573 if (strEQ(name, "EAFNOSUPPORT"))
579 if (strEQ(name, "EAGAIN"))
585 if (strEQ(name, "EALREADY"))
593 if (strEQ(name, "EBADF"))
599 if (strEQ(name, "EBUSY"))
607 if (strEQ(name, "ECHILD"))
613 if (strEQ(name, "ECHO"))
619 if (strEQ(name, "ECHOE"))
625 if (strEQ(name, "ECHOK"))
631 if (strEQ(name, "ECHONL"))
637 if (strEQ(name, "ECONNABORTED"))
643 if (strEQ(name, "ECONNREFUSED"))
649 if (strEQ(name, "ECONNRESET"))
657 if (strEQ(name, "EDEADLK"))
663 if (strEQ(name, "EDESTADDRREQ"))
669 if (strEQ(name, "EDOM"))
675 if (strEQ(name, "EDQUOT"))
683 if (strEQ(name, "EEXIST"))
691 if (strEQ(name, "EFAULT"))
697 if (strEQ(name, "EFBIG"))
705 if (strEQ(name, "EHOSTDOWN"))
711 if (strEQ(name, "EHOSTUNREACH"))
719 if (strEQ(name, "EINPROGRESS"))
725 if (strEQ(name, "EINTR"))
731 if (strEQ(name, "EINVAL"))
737 if (strEQ(name, "EIO"))
743 if (strEQ(name, "EISCONN"))
749 if (strEQ(name, "EISDIR"))
755 if (strEQ(name, "ELOOP"))
763 if (strEQ(name, "EMFILE"))
769 if (strEQ(name, "EMLINK"))
775 if (strEQ(name, "EMSGSIZE"))
783 if (strEQ(name, "ENETDOWN"))
789 if (strEQ(name, "ENETRESET"))
795 if (strEQ(name, "ENETUNREACH"))
801 if (strEQ(name, "ENOBUFS"))
807 if (strEQ(name, "ENOEXEC"))
813 if (strEQ(name, "ENOMEM"))
819 if (strEQ(name, "ENOPROTOOPT"))
825 if (strEQ(name, "ENOSPC"))
831 if (strEQ(name, "ENOTBLK"))
837 if (strEQ(name, "ENOTCONN"))
843 if (strEQ(name, "ENOTDIR"))
849 if (strEQ(name, "ENOTEMPTY"))
855 if (strEQ(name, "ENOTSOCK"))
861 if (strEQ(name, "ENOTTY"))
867 if (strEQ(name, "ENFILE"))
873 if (strEQ(name, "ENODEV"))
879 if (strEQ(name, "ENOENT"))
885 if (strEQ(name, "ENOLCK"))
891 if (strEQ(name, "ENOSYS"))
897 if (strEQ(name, "ENXIO"))
903 if (strEQ(name, "ENAMETOOLONG"))
911 if (strEQ(name, "EOF"))
917 if (strEQ(name, "EOPNOTSUPP"))
925 if (strEQ(name, "EPERM"))
931 if (strEQ(name, "EPFNOSUPPORT"))
937 if (strEQ(name, "EPIPE"))
943 if (strEQ(name, "EPROCLIM"))
949 if (strEQ(name, "EPROTONOSUPPORT"))
950 #ifdef EPROTONOSUPPORT
951 return EPROTONOSUPPORT;
955 if (strEQ(name, "EPROTOTYPE"))
963 if (strEQ(name, "ERANGE"))
969 if (strEQ(name, "EREMOTE"))
975 if (strEQ(name, "ERESTART"))
981 if (strEQ(name, "EROFS"))
989 if (strEQ(name, "ESHUTDOWN"))
995 if (strEQ(name, "ESOCKTNOSUPPORT"))
996 #ifdef ESOCKTNOSUPPORT
997 return ESOCKTNOSUPPORT;
1001 if (strEQ(name, "ESPIPE"))
1007 if (strEQ(name, "ESRCH"))
1013 if (strEQ(name, "ESTALE"))
1021 if (strEQ(name, "ETIMEDOUT"))
1027 if (strEQ(name, "ETOOMANYREFS"))
1029 return ETOOMANYREFS;
1033 if (strEQ(name, "ETXTBSY"))
1041 if (strEQ(name, "EUSERS"))
1049 if (strEQ(name, "EWOULDBLOCK"))
1057 if (strEQ(name, "EXIT_FAILURE"))
1059 return EXIT_FAILURE;
1063 if (strEQ(name, "EXIT_SUCCESS"))
1065 return EXIT_SUCCESS;
1069 if (strEQ(name, "EXDEV"))
1077 if (strEQ(name, "E2BIG"))
1085 if (strnEQ(name, "FLT_", 4)) {
1086 if (strEQ(name, "FLT_MAX"))
1092 if (strEQ(name, "FLT_MIN"))
1098 if (strEQ(name, "FLT_ROUNDS"))
1104 if (strEQ(name, "FLT_DIG"))
1110 if (strEQ(name, "FLT_EPSILON"))
1116 if (strEQ(name, "FLT_MANT_DIG"))
1118 return FLT_MANT_DIG;
1122 if (strEQ(name, "FLT_MAX_10_EXP"))
1123 #ifdef FLT_MAX_10_EXP
1124 return FLT_MAX_10_EXP;
1128 if (strEQ(name, "FLT_MAX_EXP"))
1134 if (strEQ(name, "FLT_MIN_10_EXP"))
1135 #ifdef FLT_MIN_10_EXP
1136 return FLT_MIN_10_EXP;
1140 if (strEQ(name, "FLT_MIN_EXP"))
1146 if (strEQ(name, "FLT_RADIX"))
1154 if (strnEQ(name, "F_", 2)) {
1155 if (strEQ(name, "F_DUPFD"))
1161 if (strEQ(name, "F_GETFD"))
1167 if (strEQ(name, "F_GETFL"))
1173 if (strEQ(name, "F_GETLK"))
1179 if (strEQ(name, "F_OK"))
1185 if (strEQ(name, "F_RDLCK"))
1191 if (strEQ(name, "F_SETFD"))
1197 if (strEQ(name, "F_SETFL"))
1203 if (strEQ(name, "F_SETLK"))
1209 if (strEQ(name, "F_SETLKW"))
1215 if (strEQ(name, "F_UNLCK"))
1221 if (strEQ(name, "F_WRLCK"))
1229 if (strEQ(name, "FD_CLOEXEC"))
1235 if (strEQ(name, "FILENAME_MAX"))
1237 return FILENAME_MAX;
1243 if (strEQ(name, "HUGE_VAL"))
1249 if (strEQ(name, "HUPCL"))
1257 if (strEQ(name, "INT_MAX"))
1263 if (strEQ(name, "INT_MIN"))
1269 if (strEQ(name, "ICANON"))
1275 if (strEQ(name, "ICRNL"))
1281 if (strEQ(name, "IEXTEN"))
1287 if (strEQ(name, "IGNBRK"))
1293 if (strEQ(name, "IGNCR"))
1299 if (strEQ(name, "IGNPAR"))
1305 if (strEQ(name, "INLCR"))
1311 if (strEQ(name, "INPCK"))
1317 if (strEQ(name, "ISIG"))
1323 if (strEQ(name, "ISTRIP"))
1329 if (strEQ(name, "IXOFF"))
1335 if (strEQ(name, "IXON"))
1343 if (strnEQ(name, "LC_", 3)) {
1344 if (strEQ(name, "LC_ALL"))
1350 if (strEQ(name, "LC_COLLATE"))
1356 if (strEQ(name, "LC_CTYPE"))
1362 if (strEQ(name, "LC_MONETARY"))
1368 if (strEQ(name, "LC_NUMERIC"))
1374 if (strEQ(name, "LC_TIME"))
1382 if (strnEQ(name, "LDBL_", 5)) {
1383 if (strEQ(name, "LDBL_MAX"))
1389 if (strEQ(name, "LDBL_MIN"))
1395 if (strEQ(name, "LDBL_DIG"))
1401 if (strEQ(name, "LDBL_EPSILON"))
1403 return LDBL_EPSILON;
1407 if (strEQ(name, "LDBL_MANT_DIG"))
1408 #ifdef LDBL_MANT_DIG
1409 return LDBL_MANT_DIG;
1413 if (strEQ(name, "LDBL_MAX_10_EXP"))
1414 #ifdef LDBL_MAX_10_EXP
1415 return LDBL_MAX_10_EXP;
1419 if (strEQ(name, "LDBL_MAX_EXP"))
1421 return LDBL_MAX_EXP;
1425 if (strEQ(name, "LDBL_MIN_10_EXP"))
1426 #ifdef LDBL_MIN_10_EXP
1427 return LDBL_MIN_10_EXP;
1431 if (strEQ(name, "LDBL_MIN_EXP"))
1433 return LDBL_MIN_EXP;
1439 if (strnEQ(name, "L_", 2)) {
1440 if (strEQ(name, "L_ctermid"))
1446 if (strEQ(name, "L_cuserid"))
1452 if (strEQ(name, "L_tmpname"))
1460 if (strEQ(name, "LONG_MAX"))
1466 if (strEQ(name, "LONG_MIN"))
1472 if (strEQ(name, "LINK_MAX"))
1480 if (strEQ(name, "MAX_CANON"))
1486 if (strEQ(name, "MAX_INPUT"))
1492 if (strEQ(name, "MB_CUR_MAX"))
1498 if (strEQ(name, "MB_LEN_MAX"))
1506 if (strEQ(name, "NULL")) return 0;
1507 if (strEQ(name, "NAME_MAX"))
1513 if (strEQ(name, "NCCS"))
1519 if (strEQ(name, "NGROUPS_MAX"))
1525 if (strEQ(name, "NOFLSH"))
1533 if (strnEQ(name, "O_", 2)) {
1534 if (strEQ(name, "O_APPEND"))
1540 if (strEQ(name, "O_CREAT"))
1546 if (strEQ(name, "O_TRUNC"))
1552 if (strEQ(name, "O_RDONLY"))
1558 if (strEQ(name, "O_RDWR"))
1564 if (strEQ(name, "O_WRONLY"))
1570 if (strEQ(name, "O_EXCL"))
1576 if (strEQ(name, "O_NOCTTY"))
1582 if (strEQ(name, "O_NONBLOCK"))
1588 if (strEQ(name, "O_ACCMODE"))
1596 if (strEQ(name, "OPEN_MAX"))
1602 if (strEQ(name, "OPOST"))
1610 if (strEQ(name, "PATH_MAX"))
1616 if (strEQ(name, "PARENB"))
1622 if (strEQ(name, "PARMRK"))
1628 if (strEQ(name, "PARODD"))
1634 if (strEQ(name, "PIPE_BUF"))
1642 if (strEQ(name, "RAND_MAX"))
1648 if (strEQ(name, "R_OK"))
1656 if (strnEQ(name, "SIG", 3)) {
1657 if (name[3] == '_') {
1658 if (strEQ(name, "SIG_BLOCK"))
1665 if (strEQ(name, "SIG_DFL")) return (IV)SIG_DFL;
1668 if (strEQ(name, "SIG_ERR")) return (IV)SIG_ERR;
1671 if (strEQ(name, "SIG_IGN")) return (IV)SIG_IGN;
1673 if (strEQ(name, "SIG_SETMASK"))
1679 if (strEQ(name, "SIG_UNBLOCK"))
1687 if (strEQ(name, "SIGABRT"))
1693 if (strEQ(name, "SIGALRM"))
1699 if (strEQ(name, "SIGCHLD"))
1705 if (strEQ(name, "SIGCONT"))
1711 if (strEQ(name, "SIGFPE"))
1717 if (strEQ(name, "SIGHUP"))
1723 if (strEQ(name, "SIGILL"))
1729 if (strEQ(name, "SIGINT"))
1735 if (strEQ(name, "SIGKILL"))
1741 if (strEQ(name, "SIGPIPE"))
1747 if (strEQ(name, "SIGQUIT"))
1753 if (strEQ(name, "SIGSEGV"))
1759 if (strEQ(name, "SIGSTOP"))
1765 if (strEQ(name, "SIGTERM"))
1771 if (strEQ(name, "SIGTSTP"))
1777 if (strEQ(name, "SIGTTIN"))
1783 if (strEQ(name, "SIGTTOU"))
1789 if (strEQ(name, "SIGUSR1"))
1795 if (strEQ(name, "SIGUSR2"))
1803 if (name[1] == '_') {
1804 if (strEQ(name, "S_ISGID"))
1810 if (strEQ(name, "S_ISUID"))
1816 if (strEQ(name, "S_IRGRP"))
1822 if (strEQ(name, "S_IROTH"))
1828 if (strEQ(name, "S_IRUSR"))
1834 if (strEQ(name, "S_IRWXG"))
1840 if (strEQ(name, "S_IRWXO"))
1846 if (strEQ(name, "S_IRWXU"))
1852 if (strEQ(name, "S_IWGRP"))
1858 if (strEQ(name, "S_IWOTH"))
1864 if (strEQ(name, "S_IWUSR"))
1870 if (strEQ(name, "S_IXGRP"))
1876 if (strEQ(name, "S_IXOTH"))
1882 if (strEQ(name, "S_IXUSR"))
1888 errno = EAGAIN; /* the following aren't constants */
1890 if (strEQ(name, "S_ISBLK")) return S_ISBLK(arg);
1893 if (strEQ(name, "S_ISCHR")) return S_ISCHR(arg);
1896 if (strEQ(name, "S_ISDIR")) return S_ISDIR(arg);
1899 if (strEQ(name, "S_ISFIFO")) return S_ISFIFO(arg);
1902 if (strEQ(name, "S_ISREG")) return S_ISREG(arg);
1906 if (strEQ(name, "SEEK_CUR"))
1912 if (strEQ(name, "SEEK_END"))
1918 if (strEQ(name, "SEEK_SET"))
1924 if (strEQ(name, "STREAM_MAX"))
1930 if (strEQ(name, "SHRT_MAX"))
1936 if (strEQ(name, "SHRT_MIN"))
1942 if (strnEQ(name, "SA_", 3)) {
1943 if (strEQ(name, "SA_NOCLDSTOP"))
1945 return SA_NOCLDSTOP;
1949 if (strEQ(name, "SA_NOCLDWAIT"))
1951 return SA_NOCLDWAIT;
1955 if (strEQ(name, "SA_NODEFER"))
1961 if (strEQ(name, "SA_ONSTACK"))
1967 if (strEQ(name, "SA_RESETHAND"))
1969 return SA_RESETHAND;
1973 if (strEQ(name, "SA_RESTART"))
1979 if (strEQ(name, "SA_SIGINFO"))
1987 if (strEQ(name, "SCHAR_MAX"))
1993 if (strEQ(name, "SCHAR_MIN"))
1999 if (strEQ(name, "SSIZE_MAX"))
2005 if (strEQ(name, "STDIN_FILENO"))
2007 return STDIN_FILENO;
2011 if (strEQ(name, "STDOUT_FILENO"))
2012 #ifdef STDOUT_FILENO
2013 return STDOUT_FILENO;
2017 if (strEQ(name, "STRERR_FILENO"))
2018 #ifdef STRERR_FILENO
2019 return STRERR_FILENO;
2025 if (strEQ(name, "TCIFLUSH"))
2031 if (strEQ(name, "TCIOFF"))
2037 if (strEQ(name, "TCIOFLUSH"))
2043 if (strEQ(name, "TCION"))
2049 if (strEQ(name, "TCOFLUSH"))
2055 if (strEQ(name, "TCOOFF"))
2061 if (strEQ(name, "TCOON"))
2067 if (strEQ(name, "TCSADRAIN"))
2073 if (strEQ(name, "TCSAFLUSH"))
2079 if (strEQ(name, "TCSANOW"))
2085 if (strEQ(name, "TMP_MAX"))
2091 if (strEQ(name, "TOSTOP"))
2097 if (strEQ(name, "TZNAME_MAX"))
2105 if (strEQ(name, "UCHAR_MAX"))
2111 if (strEQ(name, "UINT_MAX"))
2117 if (strEQ(name, "ULONG_MAX"))
2123 if (strEQ(name, "USHRT_MAX"))
2131 if (strEQ(name, "VEOF"))
2137 if (strEQ(name, "VEOL"))
2143 if (strEQ(name, "VERASE"))
2149 if (strEQ(name, "VINTR"))
2155 if (strEQ(name, "VKILL"))
2161 if (strEQ(name, "VMIN"))
2167 if (strEQ(name, "VQUIT"))
2173 if (strEQ(name, "VSTART"))
2179 if (strEQ(name, "VSTOP"))
2185 if (strEQ(name, "VSUSP"))
2191 if (strEQ(name, "VTIME"))
2199 if (strEQ(name, "W_OK"))
2205 if (strEQ(name, "WNOHANG"))
2211 if (strEQ(name, "WUNTRACED"))
2217 errno = EAGAIN; /* the following aren't constants */
2219 if (strEQ(name, "WEXITSTATUS")) return WEXITSTATUS(arg);
2222 if (strEQ(name, "WIFEXITED")) return WIFEXITED(arg);
2225 if (strEQ(name, "WIFSIGNALED")) return WIFSIGNALED(arg);
2228 if (strEQ(name, "WIFSTOPPED")) return WIFSTOPPED(arg);
2231 if (strEQ(name, "WSTOPSIG")) return WSTOPSIG(arg);
2234 if (strEQ(name, "WTERMSIG")) return WTERMSIG(arg);
2238 if (strEQ(name, "X_OK"))
2246 if (strnEQ(name, "_PC_", 4)) {
2247 if (strEQ(name, "_PC_CHOWN_RESTRICTED"))
2248 #ifdef _PC_CHOWN_RESTRICTED
2249 return _PC_CHOWN_RESTRICTED;
2253 if (strEQ(name, "_PC_LINK_MAX"))
2255 return _PC_LINK_MAX;
2259 if (strEQ(name, "_PC_MAX_CANON"))
2260 #ifdef _PC_MAX_CANON
2261 return _PC_MAX_CANON;
2265 if (strEQ(name, "_PC_MAX_INPUT"))
2266 #ifdef _PC_MAX_INPUT
2267 return _PC_MAX_INPUT;
2271 if (strEQ(name, "_PC_NAME_MAX"))
2273 return _PC_NAME_MAX;
2277 if (strEQ(name, "_PC_NO_TRUNC"))
2279 return _PC_NO_TRUNC;
2283 if (strEQ(name, "_PC_PATH_MAX"))
2285 return _PC_PATH_MAX;
2289 if (strEQ(name, "_PC_PIPE_BUF"))
2291 return _PC_PIPE_BUF;
2295 if (strEQ(name, "_PC_VDISABLE"))
2297 return _PC_VDISABLE;
2303 if (strnEQ(name, "_POSIX_", 7)) {
2304 if (strEQ(name, "_POSIX_ARG_MAX"))
2305 #ifdef _POSIX_ARG_MAX
2306 return _POSIX_ARG_MAX;
2310 if (strEQ(name, "_POSIX_CHILD_MAX"))
2311 #ifdef _POSIX_CHILD_MAX
2312 return _POSIX_CHILD_MAX;
2316 if (strEQ(name, "_POSIX_CHOWN_RESTRICTED"))
2317 #ifdef _POSIX_CHOWN_RESTRICTED
2318 return _POSIX_CHOWN_RESTRICTED;
2322 if (strEQ(name, "_POSIX_JOB_CONTROL"))
2323 #ifdef _POSIX_JOB_CONTROL
2324 return _POSIX_JOB_CONTROL;
2328 if (strEQ(name, "_POSIX_LINK_MAX"))
2329 #ifdef _POSIX_LINK_MAX
2330 return _POSIX_LINK_MAX;
2334 if (strEQ(name, "_POSIX_MAX_CANON"))
2335 #ifdef _POSIX_MAX_CANON
2336 return _POSIX_MAX_CANON;
2340 if (strEQ(name, "_POSIX_MAX_INPUT"))
2341 #ifdef _POSIX_MAX_INPUT
2342 return _POSIX_MAX_INPUT;
2346 if (strEQ(name, "_POSIX_NAME_MAX"))
2347 #ifdef _POSIX_NAME_MAX
2348 return _POSIX_NAME_MAX;
2352 if (strEQ(name, "_POSIX_NGROUPS_MAX"))
2353 #ifdef _POSIX_NGROUPS_MAX
2354 return _POSIX_NGROUPS_MAX;
2358 if (strEQ(name, "_POSIX_NO_TRUNC"))
2359 #ifdef _POSIX_NO_TRUNC
2360 return _POSIX_NO_TRUNC;
2364 if (strEQ(name, "_POSIX_OPEN_MAX"))
2365 #ifdef _POSIX_OPEN_MAX
2366 return _POSIX_OPEN_MAX;
2370 if (strEQ(name, "_POSIX_PATH_MAX"))
2371 #ifdef _POSIX_PATH_MAX
2372 return _POSIX_PATH_MAX;
2376 if (strEQ(name, "_POSIX_PIPE_BUF"))
2377 #ifdef _POSIX_PIPE_BUF
2378 return _POSIX_PIPE_BUF;
2382 if (strEQ(name, "_POSIX_SAVED_IDS"))
2383 #ifdef _POSIX_SAVED_IDS
2384 return _POSIX_SAVED_IDS;
2388 if (strEQ(name, "_POSIX_SSIZE_MAX"))
2389 #ifdef _POSIX_SSIZE_MAX
2390 return _POSIX_SSIZE_MAX;
2394 if (strEQ(name, "_POSIX_STREAM_MAX"))
2395 #ifdef _POSIX_STREAM_MAX
2396 return _POSIX_STREAM_MAX;
2400 if (strEQ(name, "_POSIX_TZNAME_MAX"))
2401 #ifdef _POSIX_TZNAME_MAX
2402 return _POSIX_TZNAME_MAX;
2406 if (strEQ(name, "_POSIX_VDISABLE"))
2407 #ifdef _POSIX_VDISABLE
2408 return _POSIX_VDISABLE;
2412 if (strEQ(name, "_POSIX_VERSION"))
2413 #ifdef _POSIX_VERSION
2414 return _POSIX_VERSION;
2420 if (strnEQ(name, "_SC_", 4)) {
2421 if (strEQ(name, "_SC_ARG_MAX"))
2427 if (strEQ(name, "_SC_CHILD_MAX"))
2428 #ifdef _SC_CHILD_MAX
2429 return _SC_CHILD_MAX;
2433 if (strEQ(name, "_SC_CLK_TCK"))
2439 if (strEQ(name, "_SC_JOB_CONTROL"))
2440 #ifdef _SC_JOB_CONTROL
2441 return _SC_JOB_CONTROL;
2445 if (strEQ(name, "_SC_NGROUPS_MAX"))
2446 #ifdef _SC_NGROUPS_MAX
2447 return _SC_NGROUPS_MAX;
2451 if (strEQ(name, "_SC_OPEN_MAX"))
2453 return _SC_OPEN_MAX;
2457 if (strEQ(name, "_SC_SAVED_IDS"))
2458 #ifdef _SC_SAVED_IDS
2459 return _SC_SAVED_IDS;
2463 if (strEQ(name, "_SC_STREAM_MAX"))
2464 #ifdef _SC_STREAM_MAX
2465 return _SC_STREAM_MAX;
2469 if (strEQ(name, "_SC_TZNAME_MAX"))
2470 #ifdef _SC_TZNAME_MAX
2471 return _SC_TZNAME_MAX;
2475 if (strEQ(name, "_SC_VERSION"))
2492 MODULE = SigSet PACKAGE = POSIX::SigSet PREFIX = sig
2495 new(packname = "POSIX::SigSet", ...)
2500 RETVAL = (sigset_t*)safemalloc(sizeof(sigset_t));
2501 sigemptyset(RETVAL);
2502 for (i = 1; i < items; i++)
2503 sigaddset(RETVAL, SvIV(ST(i)));
2510 POSIX::SigSet sigset
2512 safefree((char *)sigset);
2515 sigaddset(sigset, sig)
2516 POSIX::SigSet sigset
2520 sigdelset(sigset, sig)
2521 POSIX::SigSet sigset
2526 POSIX::SigSet sigset
2530 POSIX::SigSet sigset
2533 sigismember(sigset, sig)
2534 POSIX::SigSet sigset
2538 MODULE = Termios PACKAGE = POSIX::Termios PREFIX = cf
2541 new(packname = "POSIX::Termios", ...)
2546 RETVAL = (struct termios*)safemalloc(sizeof(struct termios));
2548 not_here("termios");
2555 DESTROY(termios_ref)
2556 POSIX::Termios termios_ref
2559 safefree((char *)termios_ref);
2561 not_here("termios");
2565 getattr(termios_ref, fd = 0)
2566 POSIX::Termios termios_ref
2569 RETVAL = tcgetattr(fd, termios_ref);
2574 setattr(termios_ref, fd = 0, optional_actions = 0)
2575 POSIX::Termios termios_ref
2577 int optional_actions
2579 RETVAL = tcsetattr(fd, optional_actions, termios_ref);
2584 cfgetispeed(termios_ref)
2585 POSIX::Termios termios_ref
2588 cfgetospeed(termios_ref)
2589 POSIX::Termios termios_ref
2592 getiflag(termios_ref)
2593 POSIX::Termios termios_ref
2595 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2596 RETVAL = termios_ref->c_iflag;
2598 not_here("getiflag");
2604 getoflag(termios_ref)
2605 POSIX::Termios termios_ref
2607 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2608 RETVAL = termios_ref->c_oflag;
2610 not_here("getoflag");
2616 getcflag(termios_ref)
2617 POSIX::Termios termios_ref
2619 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2620 RETVAL = termios_ref->c_cflag;
2622 not_here("getcflag");
2628 getlflag(termios_ref)
2629 POSIX::Termios termios_ref
2631 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2632 RETVAL = termios_ref->c_lflag;
2634 not_here("getlflag");
2640 getcc(termios_ref, ccix)
2641 POSIX::Termios termios_ref
2644 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2646 croak("Bad getcc subscript");
2647 RETVAL = termios_ref->c_cc[ccix];
2655 cfsetispeed(termios_ref, speed)
2656 POSIX::Termios termios_ref
2660 cfsetospeed(termios_ref, speed)
2661 POSIX::Termios termios_ref
2665 setiflag(termios_ref, iflag)
2666 POSIX::Termios termios_ref
2669 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2670 termios_ref->c_iflag = iflag;
2672 not_here("setiflag");
2676 setoflag(termios_ref, oflag)
2677 POSIX::Termios termios_ref
2680 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2681 termios_ref->c_oflag = oflag;
2683 not_here("setoflag");
2687 setcflag(termios_ref, cflag)
2688 POSIX::Termios termios_ref
2691 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2692 termios_ref->c_cflag = cflag;
2694 not_here("setcflag");
2698 setlflag(termios_ref, lflag)
2699 POSIX::Termios termios_ref
2702 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2703 termios_ref->c_lflag = lflag;
2705 not_here("setlflag");
2709 setcc(termios_ref, ccix, cc)
2710 POSIX::Termios termios_ref
2714 #ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
2716 croak("Bad setcc subscript");
2717 termios_ref->c_cc[ccix] = cc;
2723 MODULE = POSIX PACKAGE = POSIX
2732 unsigned char * charstring
2734 unsigned char *s = charstring;
2735 unsigned char *e = s + na; /* "na" set by typemap side effect */
2736 for (RETVAL = 1; RETVAL && s < e; s++)
2744 unsigned char * charstring
2746 unsigned char *s = charstring;
2747 unsigned char *e = s + na; /* "na" set by typemap side effect */
2748 for (RETVAL = 1; RETVAL && s < e; s++)
2756 unsigned char * charstring
2758 unsigned char *s = charstring;
2759 unsigned char *e = s + na; /* "na" set by typemap side effect */
2760 for (RETVAL = 1; RETVAL && s < e; s++)
2768 unsigned char * charstring
2770 unsigned char *s = charstring;
2771 unsigned char *e = s + na; /* "na" set by typemap side effect */
2772 for (RETVAL = 1; RETVAL && s < e; s++)
2780 unsigned char * charstring
2782 unsigned char *s = charstring;
2783 unsigned char *e = s + na; /* "na" set by typemap side effect */
2784 for (RETVAL = 1; RETVAL && s < e; s++)
2792 unsigned char * charstring
2794 unsigned char *s = charstring;
2795 unsigned char *e = s + na; /* "na" set by typemap side effect */
2796 for (RETVAL = 1; RETVAL && s < e; s++)
2804 unsigned char * charstring
2806 unsigned char *s = charstring;
2807 unsigned char *e = s + na; /* "na" set by typemap side effect */
2808 for (RETVAL = 1; RETVAL && s < e; s++)
2816 unsigned char * charstring
2818 unsigned char *s = charstring;
2819 unsigned char *e = s + na; /* "na" set by typemap side effect */
2820 for (RETVAL = 1; RETVAL && s < e; s++)
2828 unsigned char * charstring
2830 unsigned char *s = charstring;
2831 unsigned char *e = s + na; /* "na" set by typemap side effect */
2832 for (RETVAL = 1; RETVAL && s < e; s++)
2840 unsigned char * charstring
2842 unsigned char *s = charstring;
2843 unsigned char *e = s + na; /* "na" set by typemap side effect */
2844 for (RETVAL = 1; RETVAL && s < e; s++)
2851 isxdigit(charstring)
2852 unsigned char * charstring
2854 unsigned char *s = charstring;
2855 unsigned char *e = s + na; /* "na" set by typemap side effect */
2856 for (RETVAL = 1; RETVAL && s < e; s++)
2863 open(filename, flags = O_RDONLY, mode = 0666)
2868 if (flags & (O_APPEND|O_CREAT|O_TRUNC|O_RDWR|O_WRONLY|O_EXCL))
2869 TAINT_PROPER("open");
2870 RETVAL = open(filename, flags, mode);
2878 #ifdef HAS_LOCALECONV
2879 struct lconv *lcbuf;
2881 SET_NUMERIC_LOCAL();
2882 if (lcbuf = localeconv()) {
2884 if (lcbuf->decimal_point && *lcbuf->decimal_point)
2885 hv_store(RETVAL, "decimal_point", 13,
2886 newSVpv(lcbuf->decimal_point, 0), 0);
2887 if (lcbuf->thousands_sep && *lcbuf->thousands_sep)
2888 hv_store(RETVAL, "thousands_sep", 13,
2889 newSVpv(lcbuf->thousands_sep, 0), 0);
2890 if (lcbuf->grouping && *lcbuf->grouping)
2891 hv_store(RETVAL, "grouping", 8,
2892 newSVpv(lcbuf->grouping, 0), 0);
2893 if (lcbuf->int_curr_symbol && *lcbuf->int_curr_symbol)
2894 hv_store(RETVAL, "int_curr_symbol", 15,
2895 newSVpv(lcbuf->int_curr_symbol, 0), 0);
2896 if (lcbuf->currency_symbol && *lcbuf->currency_symbol)
2897 hv_store(RETVAL, "currency_symbol", 15,
2898 newSVpv(lcbuf->currency_symbol, 0), 0);
2899 if (lcbuf->mon_decimal_point && *lcbuf->mon_decimal_point)
2900 hv_store(RETVAL, "mon_decimal_point", 17,
2901 newSVpv(lcbuf->mon_decimal_point, 0), 0);
2902 if (lcbuf->mon_thousands_sep && *lcbuf->mon_thousands_sep)
2903 hv_store(RETVAL, "mon_thousands_sep", 17,
2904 newSVpv(lcbuf->mon_thousands_sep, 0), 0);
2905 if (lcbuf->mon_grouping && *lcbuf->mon_grouping)
2906 hv_store(RETVAL, "mon_grouping", 12,
2907 newSVpv(lcbuf->mon_grouping, 0), 0);
2908 if (lcbuf->positive_sign && *lcbuf->positive_sign)
2909 hv_store(RETVAL, "positive_sign", 13,
2910 newSVpv(lcbuf->positive_sign, 0), 0);
2911 if (lcbuf->negative_sign && *lcbuf->negative_sign)
2912 hv_store(RETVAL, "negative_sign", 13,
2913 newSVpv(lcbuf->negative_sign, 0), 0);
2915 if (lcbuf->int_frac_digits != CHAR_MAX)
2916 hv_store(RETVAL, "int_frac_digits", 15,
2917 newSViv(lcbuf->int_frac_digits), 0);
2918 if (lcbuf->frac_digits != CHAR_MAX)
2919 hv_store(RETVAL, "frac_digits", 11,
2920 newSViv(lcbuf->frac_digits), 0);
2921 if (lcbuf->p_cs_precedes != CHAR_MAX)
2922 hv_store(RETVAL, "p_cs_precedes", 13,
2923 newSViv(lcbuf->p_cs_precedes), 0);
2924 if (lcbuf->p_sep_by_space != CHAR_MAX)
2925 hv_store(RETVAL, "p_sep_by_space", 14,
2926 newSViv(lcbuf->p_sep_by_space), 0);
2927 if (lcbuf->n_cs_precedes != CHAR_MAX)
2928 hv_store(RETVAL, "n_cs_precedes", 13,
2929 newSViv(lcbuf->n_cs_precedes), 0);
2930 if (lcbuf->n_sep_by_space != CHAR_MAX)
2931 hv_store(RETVAL, "n_sep_by_space", 14,
2932 newSViv(lcbuf->n_sep_by_space), 0);
2933 if (lcbuf->p_sign_posn != CHAR_MAX)
2934 hv_store(RETVAL, "p_sign_posn", 11,
2935 newSViv(lcbuf->p_sign_posn), 0);
2936 if (lcbuf->n_sign_posn != CHAR_MAX)
2937 hv_store(RETVAL, "n_sign_posn", 11,
2938 newSViv(lcbuf->n_sign_posn), 0);
2941 localeconv(); /* A stub to call not_here(). */
2947 setlocale(category, locale = 0)
2951 RETVAL = setlocale(category, locale);
2953 #ifdef USE_LOCALE_CTYPE
2954 if (category == LC_CTYPE
2956 || category == LC_ALL
2962 if (category == LC_ALL)
2963 newctype = setlocale(LC_CTYPE, NULL);
2967 perl_new_ctype(newctype);
2969 #endif /* USE_LOCALE_CTYPE */
2970 #ifdef USE_LOCALE_COLLATE
2971 if (category == LC_COLLATE
2973 || category == LC_ALL
2979 if (category == LC_ALL)
2980 newcoll = setlocale(LC_COLLATE, NULL);
2984 perl_new_collate(newcoll);
2986 #endif /* USE_LOCALE_COLLATE */
2987 #ifdef USE_LOCALE_NUMERIC
2988 if (category == LC_NUMERIC
2990 || category == LC_ALL
2996 if (category == LC_ALL)
2997 newnum = setlocale(LC_NUMERIC, NULL);
3001 perl_new_numeric(newnum);
3003 #endif /* USE_LOCALE_NUMERIC */
3043 /* (We already know stack is long enough.) */
3044 PUSHs(sv_2mortal(newSVnv(frexp(x,&expvar))));
3045 PUSHs(sv_2mortal(newSViv(expvar)));
3061 /* (We already know stack is long enough.) */
3062 PUSHs(sv_2mortal(newSVnv(modf(x,&intvar))));
3063 PUSHs(sv_2mortal(newSVnv(intvar)));
3078 sigaction(sig, action, oldaction = 0)
3080 POSIX::SigAction action
3081 POSIX::SigAction oldaction
3084 # This code is really grody because we're trying to make the signal
3085 # interface look beautiful, which is hard.
3088 gv_fetchpv("SIG", TRUE, SVt_PVHV);
3091 struct sigaction act;
3092 struct sigaction oact;
3093 POSIX__SigSet sigset;
3095 SV** sigsvp = hv_fetch(GvHVn(siggv),
3097 strlen(sig_name[sig]),
3100 /* Remember old handler name if desired. */
3102 char *hand = SvPVx(*sigsvp, na);
3103 svp = hv_fetch(oldaction, "HANDLER", 7, TRUE);
3104 sv_setpv(*svp, *hand ? hand : "DEFAULT");
3108 /* Vector new handler through %SIG. (We always use sighandler
3109 for the C signal handler, which reads %SIG to dispatch.) */
3110 svp = hv_fetch(action, "HANDLER", 7, FALSE);
3112 croak("Can't supply an action without a HANDLER");
3113 sv_setpv(*sigsvp, SvPV(*svp, na));
3114 mg_set(*sigsvp); /* handles DEFAULT and IGNORE */
3115 act.sa_handler = sighandler;
3117 /* Set up any desired mask. */
3118 svp = hv_fetch(action, "MASK", 4, FALSE);
3119 if (svp && sv_isa(*svp, "POSIX::SigSet")) {
3121 tmp = (unsigned long)SvNV((SV*)SvRV(*svp));
3122 sigset = (sigset_t*) tmp;
3123 act.sa_mask = *sigset;
3126 sigemptyset(& act.sa_mask);
3128 /* Set up any desired flags. */
3129 svp = hv_fetch(action, "FLAGS", 5, FALSE);
3130 act.sa_flags = svp ? SvIV(*svp) : 0;
3133 /* Now work around sigaction oddities */
3134 if (action && oldaction)
3135 RETVAL = sigaction(sig, & act, & oact);
3137 RETVAL = sigaction(sig, & act, (struct sigaction *)0);
3139 RETVAL = sigaction(sig, (struct sigaction *)0, & oact);
3144 /* Get back the mask. */
3145 svp = hv_fetch(oldaction, "MASK", 4, TRUE);
3146 if (sv_isa(*svp, "POSIX::SigSet")) {
3148 tmp = (unsigned long)SvNV((SV*)SvRV(*svp));
3149 sigset = (sigset_t*) tmp;
3152 sigset = (sigset_t*)safemalloc(sizeof(sigset_t));
3153 sv_setptrobj(*svp, sigset, "POSIX::SigSet");
3155 *sigset = oact.sa_mask;
3157 /* Get back the flags. */
3158 svp = hv_fetch(oldaction, "FLAGS", 5, TRUE);
3159 sv_setiv(*svp, oact.sa_flags);
3167 POSIX::SigSet sigset
3170 sigprocmask(how, sigset, oldsigset = 0)
3172 POSIX::SigSet sigset
3173 POSIX::SigSet oldsigset
3176 sigsuspend(signal_mask)
3177 POSIX::SigSet signal_mask
3197 lseek(fd, offset, whence)
3210 if (pipe(fds) != -1) {
3212 PUSHs(sv_2mortal(newSViv(fds[0])));
3213 PUSHs(sv_2mortal(newSViv(fds[1])));
3217 read(fd, buffer, nbytes)
3219 SV *sv_buffer = SvROK(ST(1)) ? SvRV(ST(1)) : ST(1);
3223 char * buffer = sv_grow( sv_buffer, nbytes+1 );
3226 SvCUR(sv_buffer) = RETVAL;
3227 SvPOK_only(sv_buffer);
3228 *SvEND(sv_buffer) = '\0';
3229 SvTAINTED_on(sv_buffer);
3245 tcsetpgrp(fd, pgrp_id)
3254 if (uname(&buf) >= 0) {
3256 PUSHs(sv_2mortal(newSVpv(buf.sysname, 0)));
3257 PUSHs(sv_2mortal(newSVpv(buf.nodename, 0)));
3258 PUSHs(sv_2mortal(newSVpv(buf.release, 0)));
3259 PUSHs(sv_2mortal(newSVpv(buf.version, 0)));
3260 PUSHs(sv_2mortal(newSVpv(buf.machine, 0)));
3263 uname((char *) 0); /* A stub to call not_here(). */
3267 write(fd, buffer, nbytes)
3285 mbstowcs(s, pwcs, n)
3297 wcstombs(s, pwcs, n)
3319 SET_NUMERIC_LOCAL();
3320 num = strtod(str, &unparsed);
3321 PUSHs(sv_2mortal(newSVnv(num)));
3322 if (GIMME == G_ARRAY) {
3325 PUSHs(sv_2mortal(newSViv(strlen(unparsed))));
3331 strtol(str, base = 0)
3338 num = strtol(str, &unparsed, base);
3339 if (num >= IV_MIN && num <= IV_MAX)
3340 PUSHs(sv_2mortal(newSViv((IV)num)));
3342 PUSHs(sv_2mortal(newSVnv((double)num)));
3343 if (GIMME == G_ARRAY) {
3346 PUSHs(sv_2mortal(newSViv(strlen(unparsed))));
3352 strtoul(str, base = 0)
3359 num = strtoul(str, &unparsed, base);
3361 PUSHs(sv_2mortal(newSViv((IV)num)));
3363 PUSHs(sv_2mortal(newSVnv((double)num)));
3364 if (GIMME == G_ARRAY) {
3367 PUSHs(sv_2mortal(newSViv(strlen(unparsed))));
3379 char *p = SvPV(src,srclen);
3381 ST(0) = sv_2mortal(NEWSV(800,srclen));
3382 dstlen = strxfrm(SvPVX(ST(0)), p, (size_t)srclen);
3383 if (dstlen > srclen) {
3385 SvGROW(ST(0), dstlen);
3386 strxfrm(SvPVX(ST(0)), p, (size_t)dstlen);
3389 SvCUR(ST(0)) = dstlen;
3394 mkfifo(filename, mode)
3398 TAINT_PROPER("mkfifo");
3399 RETVAL = mkfifo(filename, mode);
3415 tcflush(fd, queue_selector)
3420 tcsendbreak(fd, duration)
3425 asctime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)
3438 init_tm(&mytm); /* XXX workaround - see init_tm() above */
3441 mytm.tm_hour = hour;
3442 mytm.tm_mday = mday;
3444 mytm.tm_year = year;
3445 mytm.tm_wday = wday;
3446 mytm.tm_yday = yday;
3447 mytm.tm_isdst = isdst;
3448 RETVAL = asctime(&mytm);
3465 realtime = times( &tms );
3467 PUSHs( sv_2mortal( newSViv( (IV) realtime ) ) );
3468 PUSHs( sv_2mortal( newSViv( (IV) tms.tms_utime ) ) );
3469 PUSHs( sv_2mortal( newSViv( (IV) tms.tms_stime ) ) );
3470 PUSHs( sv_2mortal( newSViv( (IV) tms.tms_cutime ) ) );
3471 PUSHs( sv_2mortal( newSViv( (IV) tms.tms_cstime ) ) );
3474 difftime(time1, time2)
3479 mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)
3492 init_tm(&mytm); /* XXX workaround - see init_tm() above */
3495 mytm.tm_hour = hour;
3496 mytm.tm_mday = mday;
3498 mytm.tm_year = year;
3499 mytm.tm_wday = wday;
3500 mytm.tm_yday = yday;
3501 mytm.tm_isdst = isdst;
3502 RETVAL = mktime(&mytm);
3508 strftime(fmt, sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)
3524 init_tm(&mytm); /* XXX workaround - see init_tm() above */
3527 mytm.tm_hour = hour;
3528 mytm.tm_mday = mday;
3530 mytm.tm_year = year;
3531 mytm.tm_wday = wday;
3532 mytm.tm_yday = yday;
3533 mytm.tm_isdst = isdst;
3534 len = strftime(tmpbuf, sizeof tmpbuf, fmt, &mytm);
3535 ST(0) = sv_2mortal(newSVpv(tmpbuf, len));
3545 PUSHs(sv_2mortal(newSVpv(tzname[0],strlen(tzname[0]))));
3546 PUSHs(sv_2mortal(newSVpv(tzname[1],strlen(tzname[1]))));
3549 access(filename, mode)
3567 pathconf(filename, name)