diff options
Diffstat (limited to 'lib/posix/posix_linux_amd64.nim')
-rw-r--r-- | lib/posix/posix_linux_amd64.nim | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/posix/posix_linux_amd64.nim b/lib/posix/posix_linux_amd64.nim index bb82d9e5e..8d11c507d 100644 --- a/lib/posix/posix_linux_amd64.nim +++ b/lib/posix/posix_linux_amd64.nim @@ -34,9 +34,6 @@ type type SocketHandle* = distinct cint # The type used to represent socket descriptors -# not detected by detect.nim, guarded by #ifdef __USE_UNIX98 in glibc -const SIG_HOLD* = cast[Sighandler](2) - type Time* {.importc: "time_t", header: "<time.h>".} = distinct clong @@ -50,7 +47,7 @@ type d_ino*: Ino d_off*: Off d_reclen*: cushort - d_type*: int8 # cuchar really! + d_type*: int8 # uint8 really! d_name*: array[256, cchar] Tflock* {.importc: "struct flock", final, pure, @@ -171,7 +168,7 @@ type Pthread_key* {.importc: "pthread_key_t", header: "<sys/types.h>".} = cuint Pthread_mutex* {.importc: "pthread_mutex_t", header: "<sys/types.h>", pure, final.} = object - abi: array[48 div sizeof(clong), clong] + abi: array[40 div sizeof(clong), clong] Pthread_mutexattr* {.importc: "pthread_mutexattr_t", header: "<sys/types.h>", pure, final.} = object abi: array[4 div sizeof(cint), cint] @@ -228,7 +225,7 @@ type st_mode*: Mode ## Mode of file (see below). st_uid*: Uid ## User ID of file. st_gid*: Gid ## Group ID of file. - pad0: cint + pad0 {.importc: "__pad0".}: cint st_rdev*: Dev ## Device ID (if file is character or block special). st_size*: Off ## For regular files, the file size in bytes. ## For symbolic links, the length in bytes of the @@ -244,8 +241,6 @@ type st_atim*: Timespec ## Time of last access. st_mtim*: Timespec ## Time of last data modification. st_ctim*: Timespec ## Time of last status change. - reserved: array[3, clong] - Statvfs* {.importc: "struct statvfs", header: "<sys/statvfs.h>", final, pure.} = object ## struct statvfs @@ -314,7 +309,7 @@ type sa_mask*: Sigset ## Set of signals to be blocked during execution of ## the signal handling function. sa_flags*: cint ## Special flags. - sa_sigaction*: proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.} + sa_restorer: proc() {.noconv.} ## not intended for application use. Stack* {.importc: "stack_t", header: "<signal.h>", final, pure.} = object ## stack_t @@ -330,17 +325,23 @@ type SigInfo* {.importc: "siginfo_t", header: "<signal.h>", final, pure.} = object ## siginfo_t si_signo*: cint ## Signal number. - si_code*: cint ## Signal code. si_errno*: cint ## If non-zero, an errno value associated with ## this signal, as defined in <errno.h>. + si_code*: cint ## Signal code. si_pid*: Pid ## Sending process ID. si_uid*: Uid ## Real user ID of sending process. si_addr*: pointer ## Address of faulting instruction. si_status*: cint ## Exit value or signal. si_band*: int ## Band event for SIGPOLL. si_value*: SigVal ## Signal value. - pad {.importc: "_pad"}: array[128 - 56, uint8] + pad {.importc: "_pad".}: array[128 - 56, uint8] +template sa_sigaction*(v: Sigaction): proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.} = + cast[proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.}](v.sa_handler) +proc `sa_sigaction=`*(v: var Sigaction, x: proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.}) = + v.sa_handler = cast[proc (x: cint) {.noconv.}](x) + +type Nl_item* {.importc: "nl_item", header: "<nl_types.h>".} = cint Nl_catd* {.importc: "nl_catd", header: "<nl_types.h>".} = pointer @@ -433,8 +434,8 @@ type header: "<sys/socket.h>", pure, final.} = object ## struct sockaddr_storage ss_family*: TSa_Family ## Address family. - ss_padding: array[128 - sizeof(cshort) - sizeof(culong), char] - ss_align: clong + ss_padding {.importc: "__ss_padding".}: array[128 - sizeof(cshort) - sizeof(culong), char] + ss_align {.importc: "__ss_align".}: clong Tif_nameindex* {.importc: "struct if_nameindex", final, pure, header: "<net/if.h>".} = object ## struct if_nameindex @@ -573,8 +574,6 @@ var # Regenerate using detect.nim! include posix_linux_amd64_consts -const POSIX_SPAWN_USEVFORK* = cint(0x40) # needs _GNU_SOURCE! - # <sys/wait.h> proc WEXITSTATUS*(s: cint): cint = (s and 0xff00) shr 8 proc WTERMSIG*(s:cint): cint = s and 0x7f |