2 * D header file for POSIX.
4 * Copyright: Public Domain
5 * License: Public Domain
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
9 module stdc.posix.unistd;
11 private import stdc.posix.config;
12 private import stdc.stddef;
13 public import stdc.posix.inttypes; // for intptr_t
14 public import stdc.posix.sys.types; // for size_t, ssize_t, uid_t, gid_t, off_t, pid_t, useconds_t
18 const STDIN_FILENO = 0;
19 const STDOUT_FILENO = 1;
20 const STDERR_FILENO = 2;
27 int access(in char*, int);
30 int chown(in char*, uid_t, gid_t);
32 size_t confstr(int, char*, size_t);
35 int execl(in char*, in char*, ...);
36 int execle(in char*, in char*, ...);
37 int execlp(in char*, in char*, ...);
38 int execv(in char*, in char**);
39 int execve(in char*, in char**, in char**);
40 int execvp(in char*, in char**);
42 int fchown(int, uid_t, gid_t);
44 c_long fpathconf(int, int);
45 //int ftruncate(int, off_t);
46 char* getcwd(char*, size_t);
50 int getgroups(int, gid_t *);
51 int gethostname(char*, size_t);
53 int getlogin_r(char*, size_t);
54 int getopt(int, in char**, in char*);
60 int link(in char*, in char*);
61 //off_t lseek(int, off_t, int);
62 c_long pathconf(in char*, int);
65 ssize_t read(int, void*, size_t);
66 ssize_t readlink(in char*, char*, size_t);
71 int setpgid(pid_t, pid_t);
75 int symlink(in char*, in char*);
78 int tcsetpgrp(int, pid_t);
80 int ttyname_r(int, char*, size_t);
82 ssize_t write(int, in void*, size_t);
86 static if( __USE_FILE_OFFSET64 )
88 off_t lseek64(int, off_t, int);
93 off_t lseek(int, off_t, int);
95 static if( __USE_LARGEFILE64 )
97 int ftruncate64(int, off_t);
98 alias ftruncate64 ftruncate;
102 int ftruncate(int, off_t);
107 off_t lseek(int, off_t, int);
108 int ftruncate(int, off_t);
127 _CS_V6_WIDTH_RESTRICTED_ENVS,
129 _CS_GNU_LIBC_VERSION,
130 _CS_GNU_LIBPTHREAD_VERSION,
132 _CS_LFS_CFLAGS = 1000,
141 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
142 _CS_XBS5_ILP32_OFF32_LDFLAGS,
143 _CS_XBS5_ILP32_OFF32_LIBS,
144 _CS_XBS5_ILP32_OFF32_LINTFLAGS,
145 _CS_XBS5_ILP32_OFFBIG_CFLAGS,
146 _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
147 _CS_XBS5_ILP32_OFFBIG_LIBS,
148 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
149 _CS_XBS5_LP64_OFF64_CFLAGS,
150 _CS_XBS5_LP64_OFF64_LDFLAGS,
151 _CS_XBS5_LP64_OFF64_LIBS,
152 _CS_XBS5_LP64_OFF64_LINTFLAGS,
153 _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
154 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
155 _CS_XBS5_LPBIG_OFFBIG_LIBS,
156 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
158 _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
159 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
160 _CS_POSIX_V6_ILP32_OFF32_LIBS,
161 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
162 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
163 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
164 _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
165 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
166 _CS_POSIX_V6_LP64_OFF64_CFLAGS,
167 _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
168 _CS_POSIX_V6_LP64_OFF64_LIBS,
169 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
170 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
171 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
172 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
173 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
184 _PC_CHOWN_RESTRICTED,
192 _PC_REC_INCR_XFER_SIZE,
193 _PC_REC_MAX_XFER_SIZE,
194 _PC_REC_MIN_XFER_SIZE,
212 _SC_REALTIME_SIGNALS,
213 _SC_PRIORITY_SCHEDULING,
222 _SC_MEMORY_PROTECTION,
225 _SC_SHARED_MEMORY_OBJECTS,
228 _SC_AIO_PRIO_DELTA_MAX,
234 _SC_PAGE_SIZE = _SC_PAGESIZE,
245 _SC_COLL_WEIGHTS_MAX,
250 _SC_CHARCLASS_NAME_MAX,
268 _SC_IOV_MAX = _SC_UIO_MAXIOV,
269 _SC_PII_INTERNET_STREAM,
270 _SC_PII_INTERNET_DGRAM,
277 _SC_THREAD_SAFE_FUNCTIONS,
278 _SC_GETGR_R_SIZE_MAX,
279 _SC_GETPW_R_SIZE_MAX,
282 _SC_THREAD_DESTRUCTOR_ITERATIONS,
284 _SC_THREAD_STACK_MIN,
285 _SC_THREAD_THREADS_MAX,
286 _SC_THREAD_ATTR_STACKADDR,
287 _SC_THREAD_ATTR_STACKSIZE,
288 _SC_THREAD_PRIORITY_SCHEDULING,
289 _SC_THREAD_PRIO_INHERIT,
290 _SC_THREAD_PRIO_PROTECT,
291 _SC_THREAD_PROCESS_SHARED,
293 _SC_NPROCESSORS_CONF,
294 _SC_NPROCESSORS_ONLN,
301 _SC_XOPEN_XCU_VERSION,
341 _SC_XBS5_ILP32_OFF32,
342 _SC_XBS5_ILP32_OFFBIG,
344 _SC_XBS5_LPBIG_OFFBIG,
348 _SC_XOPEN_REALTIME_THREADS,
354 _SC_C_LANG_SUPPORT_R,
360 _SC_DEVICE_SPECIFIC_R,
371 _SC_READER_WRITER_LOCKS,
379 _SC_THREAD_SPORADIC_SERVER,
381 _SC_SYSTEM_DATABASE_R,
383 _SC_TYPED_MEMORY_OBJECTS,
387 _SC_2_PBS_ACCOUNTING,
393 _SC_2_PBS_CHECKPOINT,
402 _SC_TRACE_EVENT_FILTER,
406 _SC_LEVEL1_ICACHE_SIZE,
407 _SC_LEVEL1_ICACHE_ASSOC,
408 _SC_LEVEL1_ICACHE_LINESIZE,
409 _SC_LEVEL1_DCACHE_SIZE,
410 _SC_LEVEL1_DCACHE_ASSOC,
411 _SC_LEVEL1_DCACHE_LINESIZE,
412 _SC_LEVEL2_CACHE_SIZE,
413 _SC_LEVEL2_CACHE_ASSOC,
414 _SC_LEVEL2_CACHE_LINESIZE,
415 _SC_LEVEL3_CACHE_SIZE,
416 _SC_LEVEL3_CACHE_ASSOC,
417 _SC_LEVEL3_CACHE_LINESIZE,
418 _SC_LEVEL4_CACHE_SIZE,
419 _SC_LEVEL4_CACHE_ASSOC,
420 _SC_LEVEL4_CACHE_LINESIZE,
422 _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
426 else version( darwin )
438 else version( freebsd )
452 // File Synchronization (FSC)
459 // Synchronized I/O (SIO)
469 char* crypt(in char*, in char*);
470 char* ctermid(char*);
471 void encrypt(char[64], int);
474 pid_t getpgid(pid_t);
476 char* getwd(char*); // LEGACY
477 int lchown(in char*, uid_t, gid_t);
478 int lockf(int, int, off_t);
480 ssize_t pread(int, void*, size_t, off_t);
481 ssize_t pwrite(int, in void*, size_t, off_t);
483 int setregid(gid_t, gid_t);
484 int setreuid(uid_t, uid_t);
485 void swab(in void*, void*, ssize_t);
487 int truncate(in char*, off_t);
488 useconds_t ualarm(useconds_t, useconds_t);
489 int usleep(useconds_t);
495 char* crypt(in char*, in char*);
496 char* ctermid(char*);
497 void encrypt(char[64], int);
500 pid_t getpgid(pid_t);
502 char* getwd(char*); // LEGACY
503 int lchown(in char*, uid_t, gid_t);
504 //int lockf(int, int, off_t);
506 //ssize_t pread(int, void*, size_t, off_t);
507 //ssize_t pwrite(int, in void*, size_t, off_t);
509 int setregid(gid_t, gid_t);
510 int setreuid(uid_t, uid_t);
511 void swab(in void*, void*, ssize_t);
513 //int truncate(in char*, off_t);
514 useconds_t ualarm(useconds_t, useconds_t);
515 int usleep(useconds_t);
518 static if( __USE_LARGEFILE64 )
520 int lockf64(int, int, off_t);
523 ssize_t pread64(int, void*, size_t, off_t);
526 ssize_t pwrite64(int, in void*, size_t, off_t);
527 alias pwrite64 pwrite;
529 int truncate64(in char*, off_t);
530 alias truncate64 truncate;
534 int lockf(int, int, off_t);
535 ssize_t pread(int, void*, size_t, off_t);
536 ssize_t pwrite(int, in void*, size_t, off_t);
537 int truncate(in char*, off_t);
540 else version (darwin)
542 char* crypt(in char*, in char*);
543 char* ctermid(char*);
544 void encrypt(char[64], int);
547 pid_t getpgid(pid_t);
549 char* getwd(char*); // LEGACY
550 int lchown(in char*, uid_t, gid_t);
551 int lockf(int, int, off_t);
553 ssize_t pread(int, void*, size_t, off_t);
554 ssize_t pwrite(int, in void*, size_t, off_t);
556 int setregid(gid_t, gid_t);
557 int setreuid(uid_t, uid_t);
558 void swab(in void*, void*, ssize_t);
560 int truncate(in char*, off_t);
561 useconds_t ualarm(useconds_t, useconds_t);
562 int usleep(useconds_t);
565 else version (freebsd)
567 char* crypt(in char*, in char*);
568 //char* ctermid(char*);
569 void encrypt(char*, int);
574 char* getwd(char*); // LEGACY
575 int lchown(in char*, uid_t, gid_t);
576 int lockf(int, int, off_t);
578 ssize_t pread(int, void*, size_t, off_t);
579 ssize_t pwrite(int, in void*, size_t, off_t);
580 int setpgrp(pid_t, pid_t);
581 int setregid(gid_t, gid_t);
582 int setreuid(uid_t, uid_t);
583 void swab(in void*, void*, ssize_t);
585 int truncate(in char*, off_t);
586 useconds_t ualarm(useconds_t, useconds_t);
587 int usleep(useconds_t);