]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/unix/ffi/linux/linux.factor
use radix literals
[factor.git] / basis / unix / ffi / linux / linux.factor
index 260796b5e4146ff0ecf6a2db4dff9a2c927cd20f..0e568ba46af24e2599bec3cd6122f2af2504463d 100644 (file)
@@ -5,15 +5,15 @@ IN: unix.ffi
 
 CONSTANT: MAXPATHLEN 1024
 
-CONSTANT: O_RDONLY   HEX: 0000
-CONSTANT: O_WRONLY   HEX: 0001
-CONSTANT: O_RDWR     HEX: 0002
-CONSTANT: O_CREAT    HEX: 0040
-CONSTANT: O_EXCL     HEX: 0080
-CONSTANT: O_NOCTTY   HEX: 0100
-CONSTANT: O_TRUNC    HEX: 0200
-CONSTANT: O_APPEND   HEX: 0400
-CONSTANT: O_NONBLOCK HEX: 0800
+CONSTANT: O_RDONLY   0x0000
+CONSTANT: O_WRONLY   0x0001
+CONSTANT: O_RDWR     0x0002
+CONSTANT: O_CREAT    0x0040
+CONSTANT: O_EXCL     0x0080
+CONSTANT: O_NOCTTY   0x0100
+CONSTANT: O_TRUNC    0x0200
+CONSTANT: O_APPEND   0x0400
+CONSTANT: O_NONBLOCK 0x0800
 
 ALIAS: O_NDELAY O_NONBLOCK
 
@@ -23,8 +23,8 @@ CONSTANT: FD_SETSIZE 1024
 
 CONSTANT: SO_REUSEADDR 2
 CONSTANT: SO_OOBINLINE 10
-CONSTANT: SO_SNDTIMEO HEX: 15
-CONSTANT: SO_RCVTIMEO HEX: 14
+CONSTANT: SO_SNDTIMEO 0x15
+CONSTANT: SO_RCVTIMEO 0x14
 
 CONSTANT: F_SETFD 2
 CONSTANT: FD_CLOEXEC 1
@@ -38,7 +38,7 @@ STRUCT: addrinfo
     { protocol int }
     { addrlen socklen_t }
     { addr void* }
-    { canonname char* }
+    { canonname c-string }
     { next addrinfo* } ;
 
 STRUCT: sockaddr-in
@@ -62,6 +62,7 @@ STRUCT: sockaddr-un
 
 CONSTANT: SOCK_STREAM 1
 CONSTANT: SOCK_DGRAM 2
+CONSTANT: SOCK_RAW 3
 
 CONSTANT: AF_UNSPEC 0
 CONSTANT: AF_UNIX 1
@@ -83,13 +84,13 @@ CONSTANT: SEEK_CUR 1
 CONSTANT: SEEK_END 2
 
 STRUCT: passwd
-    { pw_name char* }
-    { pw_passwd char* }
+    { pw_name c-string }
+    { pw_passwd c-string }
     { pw_uid uid_t }
     { pw_gid gid_t }
-    { pw_gecos char* }
-    { pw_dir char* }
-    { pw_shell char* } ;
+    { pw_gecos c-string }
+    { pw_dir c-string }
+    { pw_shell c-string } ;
 
 ! dirent64
 STRUCT: dirent
@@ -99,7 +100,7 @@ STRUCT: dirent
     { d_type uchar }
     { d_name char[256] } ;
 
-FUNCTION: int open64 ( char* path, int flags, int prot ) ;
+FUNCTION: int open64 ( c-string path, int flags, int prot ) ;
 FUNCTION: dirent* readdir64 ( DIR* dirp ) ;
 FUNCTION: int readdir64_r ( void* dirp, dirent* entry, dirent** result ) ;
 
@@ -234,3 +235,38 @@ CONSTANT: EKEYREVOKED 128
 CONSTANT: EKEYREJECTED 129
 CONSTANT: EOWNERDEAD 130
 CONSTANT: ENOTRECOVERABLE 131
+
+CONSTANT: SIGHUP           1
+CONSTANT: SIGINT           2
+CONSTANT: SIGQUIT          3
+CONSTANT: SIGILL           4
+CONSTANT: SIGTRAP          5
+CONSTANT: SIGABRT          6
+CONSTANT: SIGIOT           6
+CONSTANT: SIGBUS           7
+CONSTANT: SIGFPE           8
+CONSTANT: SIGKILL          9
+CONSTANT: SIGUSR1         10
+CONSTANT: SIGSEGV         11
+CONSTANT: SIGUSR2         12
+CONSTANT: SIGPIPE         13
+CONSTANT: SIGALRM         14
+CONSTANT: SIGTERM         15
+CONSTANT: SIGSTKFLT       16
+CONSTANT: SIGCHLD         17
+ALIAS:    SIGCLD          SIGCHLD
+CONSTANT: SIGCONT         18
+CONSTANT: SIGSTOP         19
+CONSTANT: SIGTSTP         20
+CONSTANT: SIGTTIN         21
+CONSTANT: SIGTTOU         22
+CONSTANT: SIGURG          23
+CONSTANT: SIGXCPU         24
+CONSTANT: SIGXFSZ         25
+CONSTANT: SIGVTALRM       26
+CONSTANT: SIGPROF         27
+CONSTANT: SIGWINCH        28
+CONSTANT: SIGIO           29
+ALIAS:    SIGPOLL         SIGIO
+CONSTANT: SIGPWR          30
+CONSTANT: SIGSYS          31