]> git.lizzy.rs Git - rust.git/blobdiff - src/liblibc/lib.rs
rustc: Add search paths to dylib load paths
[rust.git] / src / liblibc / lib.rs
index bf2baf95b84f1d9a4405c09af1dbc8bdfe58e826..a4593c1cb5afc745b804ded01209c90633b38f04 100644 (file)
@@ -8,26 +8,32 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[feature(globs)];
-#[crate_id = "libc#0.10-pre"];
-#[experimental];
+#![feature(globs)]
+#![crate_id = "libc#0.11-pre"]
+#![experimental]
+#![no_std] // we don't need std, and we can't have std, since it doesn't exist
+           // yet. std depends on us.
+#![crate_type = "rlib"]
+#![crate_type = "dylib"]
 
 /*!
 * Bindings for the C standard library and other platform libraries
 *
-* This module contains bindings to the C standard library,
-* organized into modules by their defining standard.
-* Additionally, it contains some assorted platform-specific definitions.
-* For convenience, most functions and types are reexported from `libc`,
-* so `pub use std::*` will import the available
-* C bindings as appropriate for the target platform. The exact
-* set of functions available are platform specific.
+* **NOTE:** These are *architecture and libc* specific. On Linux, these
+* bindings are only correct for glibc.
 *
-* *Note* Because these definitions are platform-specific, some may not appear in
-* the generated documentation.
+* This module contains bindings to the C standard library, organized into
+* modules by their defining standard.  Additionally, it contains some assorted
+* platform-specific definitions.  For convenience, most functions and types
+* are reexported, so `use libc::*` will import the available C bindings as
+* appropriate for the target platform. The exact set of functions available
+* are platform specific.
 *
-* We consider the following specs reasonably normative with respect
-* to interoperating with the C standard library (libc/msvcrt):
+* *Note:* Because these definitions are platform-specific, some may not appear
+* in the generated documentation.
+*
+* We consider the following specs reasonably normative with respect to
+* interoperating with the C standard library (libc/msvcrt):
 *
 * * ISO 9899:1990 ('C95', 'ANSI C', 'Standard C'), NA1, 1995.
 * * ISO 9899:1999 ('C99' or 'C9x').
 * * ISO 9945:2001 / IEEE 1003.1-2001 ('POSIX:2001', 'SUSv3').
 * * ISO 9945:2008 / IEEE 1003.1-2008 ('POSIX:2008', 'SUSv4').
 *
-* Note that any reference to the 1996 revision of POSIX, or any revs
-* between 1990 (when '88 was approved at ISO) and 2001 (when the next
-* actual revision-revision happened), are merely additions of other
-* chapters (1b and 1c) outside the core interfaces.
+* Note that any reference to the 1996 revision of POSIX, or any revs between
+* 1990 (when '88 was approved at ISO) and 2001 (when the next actual
+* revision-revision happened), are merely additions of other chapters (1b and
+* 1c) outside the core interfaces.
 *
 * Despite having several names each, these are *reasonably* coherent
 * point-in-time, list-of-definition sorts of specs. You can get each under a
 * sanity while editing, filling-in-details and eliminating duplication) into
 * definitions common-to-all (held in modules named c95, c99, posix88, posix01
 * and posix08) and definitions that appear only on *some* platforms (named
-* 'extra'). This would be things like significant OSX foundation kit, or
-* win32 library kernel32.dll, or various fancy glibc, linux or BSD
-* extensions.
+* 'extra'). This would be things like significant OSX foundation kit, or win32
+* library kernel32.dll, or various fancy glibc, linux or BSD extensions.
 *
 * In addition to the per-platform 'extra' modules, we define a module of
 * 'common BSD' libc routines that never quite made it into POSIX but show up
-* in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the
-* final one from Berkeley after the lawsuits died down and the CSRG
-* dissolved.
+* in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the final
+* one from Berkeley after the lawsuits died down and the CSRG dissolved.
 */
 
 #![allow(non_camel_case_types)]
 #[cfg(test)] extern crate test;
 #[cfg(test)] extern crate native;
 
-// Initial glob-exports mean that all the contents of all the modules
-// wind up exported, if you're interested in writing platform-specific code.
-
-pub use types::common::c95::*;
-pub use types::common::c99::*;
-pub use types::common::posix88::*;
-pub use types::common::posix01::*;
-pub use types::common::posix08::*;
-pub use types::common::bsd44::*;
-pub use types::os::common::posix01::*;
-pub use types::os::common::bsd44::*;
-pub use types::os::arch::c95::*;
-pub use types::os::arch::c99::*;
-pub use types::os::arch::posix88::*;
-pub use types::os::arch::posix01::*;
-pub use types::os::arch::posix08::*;
-pub use types::os::arch::bsd44::*;
-pub use types::os::arch::extra::*;
-
-pub use consts::os::c95::*;
-pub use consts::os::c99::*;
-pub use consts::os::posix88::*;
-pub use consts::os::posix01::*;
-pub use consts::os::posix08::*;
-pub use consts::os::bsd44::*;
-pub use consts::os::extra::*;
-pub use consts::os::sysconf::*;
-
-pub use funcs::c95::ctype::*;
-pub use funcs::c95::stdio::*;
-pub use funcs::c95::stdlib::*;
-pub use funcs::c95::string::*;
-
-pub use funcs::posix88::stat_::*;
-pub use funcs::posix88::stdio::*;
-pub use funcs::posix88::fcntl::*;
-pub use funcs::posix88::dirent::*;
-pub use funcs::posix88::unistd::*;
-pub use funcs::posix88::mman::*;
-
-pub use funcs::posix01::stat_::*;
-pub use funcs::posix01::unistd::*;
-pub use funcs::posix01::glob::*;
-pub use funcs::posix01::mman::*;
-pub use funcs::posix08::unistd::*;
-
-pub use funcs::bsd43::*;
-pub use funcs::bsd44::*;
-pub use funcs::extra::*;
-
-#[cfg(target_os = "win32")]
-pub use funcs::extra::kernel32::*;
-#[cfg(target_os = "win32")]
-pub use funcs::extra::msvcrt::*;
-
 // Explicit export lists for the intersection (provided here) mean that
 // you can write more-platform-agnostic code if you stick to just these
 // symbols.
 
 pub use types::common::c95::{FILE, c_void, fpos_t};
+pub use types::common::c99::{int8_t, int16_t, int32_t, int64_t};
+pub use types::common::c99::{uint8_t, uint16_t, uint32_t, uint64_t};
 pub use types::common::posix88::{DIR, dirent_t};
-pub use types::os::arch::c95::{c_char, c_double, c_float, c_int};
+pub use types::os::common::posix01::{timeval};
+pub use types::os::common::bsd44::{addrinfo, in_addr, in6_addr, sockaddr_storage};
+pub use types::os::common::bsd44::{ip_mreq, ip6_mreq, sockaddr, sockaddr_un};
+pub use types::os::common::bsd44::{sa_family_t, sockaddr_in, sockaddr_in6, socklen_t};
+pub use types::os::arch::c95::{c_char, c_double, c_float, c_int, c_uint};
 pub use types::os::arch::c95::{c_long, c_short, c_uchar, c_ulong};
 pub use types::os::arch::c95::{c_ushort, clock_t, ptrdiff_t};
-pub use types::os::arch::c95::{size_t, time_t};
-pub use types::os::arch::c99::{c_longlong, c_ulonglong, intptr_t};
-pub use types::os::arch::c99::{uintptr_t};
-pub use types::os::arch::posix88::{dev_t, dirent_t, ino_t, mode_t};
+pub use types::os::arch::c95::{size_t, time_t, suseconds_t};
+pub use types::os::arch::c99::{c_longlong, c_ulonglong};
+pub use types::os::arch::c99::{intptr_t, uintptr_t};
+pub use types::os::arch::posix88::{dev_t, ino_t, mode_t};
 pub use types::os::arch::posix88::{off_t, pid_t, ssize_t};
 
 pub use consts::os::c95::{_IOFBF, _IOLBF, _IONBF, BUFSIZ, EOF};
 pub use consts::os::posix88::{R_OK, S_IEXEC, S_IFBLK, S_IFCHR};
 pub use consts::os::posix88::{S_IFDIR, S_IFIFO, S_IFMT, S_IFREG, S_IFLNK};
 pub use consts::os::posix88::{S_IREAD, S_IRUSR, S_IRWXU, S_IWUSR};
-pub use consts::os::posix88::{STDERR_FILENO, STDIN_FILENO};
+pub use consts::os::posix88::{STDERR_FILENO, STDIN_FILENO, S_IXUSR};
 pub use consts::os::posix88::{STDOUT_FILENO, W_OK, X_OK};
+pub use consts::os::bsd44::{AF_INET, AF_INET6, SOCK_STREAM, SOCK_DGRAM};
+pub use consts::os::bsd44::{IPPROTO_IP, IPPROTO_IPV6, IPPROTO_TCP, TCP_NODELAY};
+pub use consts::os::bsd44::{SOL_SOCKET, SO_KEEPALIVE, SO_ERROR};
+pub use consts::os::bsd44::{SO_REUSEADDR, SO_BROADCAST, SHUT_WR, IP_MULTICAST_LOOP};
+pub use consts::os::bsd44::{IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP};
+pub use consts::os::bsd44::{IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP};
+pub use consts::os::bsd44::{IP_MULTICAST_TTL, IP_TTL};
 
 pub use funcs::c95::ctype::{isalnum, isalpha, iscntrl, isdigit};
 pub use funcs::c95::ctype::{islower, isprint, ispunct, isspace};
 pub use funcs::c95::stdio::{fclose, feof, ferror, fflush, fgetc};
 pub use funcs::c95::stdio::{fgetpos, fgets, fopen, fputc, fputs};
 pub use funcs::c95::stdio::{fread, freopen, fseek, fsetpos, ftell};
-pub use funcs::c95::stdio::{fwrite, perror, puts, remove, rewind};
+pub use funcs::c95::stdio::{fwrite, perror, puts, remove, rename, rewind};
 pub use funcs::c95::stdio::{setbuf, setvbuf, tmpfile, ungetc};
 
 pub use funcs::c95::stdlib::{abs, atof, atoi, calloc, exit, _exit};
 pub use funcs::posix88::unistd::{getpid, isatty, lseek, pipe, read};
 pub use funcs::posix88::unistd::{rmdir, unlink, write};
 
+pub use funcs::bsd43::{socket, setsockopt, bind, send, recv, recvfrom};
+pub use funcs::bsd43::{listen, sendto, accept, connect, getpeername, getsockname};
+pub use funcs::bsd43::{shutdown};
+
+// But we also reexport most everything
+// if you're interested in writing platform-specific code.
+
+// FIXME: This is a mess, but the design of this entire module needs to be
+// reconsidered, so I'm not inclined to do better right now. As part of
+// #11870 I removed all the pub globs here, leaving explicit reexports
+// of everything that is actually used in-tree.
+//
+// So the following exports don't follow any particular plan.
+
+#[cfg(unix)] pub use consts::os::sysconf::{_SC_PAGESIZE};
+#[cfg(unix)] pub use consts::os::posix88::{PROT_READ, PROT_WRITE, PROT_EXEC};
+#[cfg(unix)] pub use consts::os::posix88::{MAP_FIXED, MAP_FILE, MAP_ANON, MAP_PRIVATE, MAP_FAILED};
+#[cfg(unix)] pub use consts::os::posix88::{EACCES, EBADF, EINVAL, ENODEV, ENOMEM};
+#[cfg(unix)] pub use consts::os::posix88::{ECONNREFUSED, ECONNRESET, EPERM, EPIPE};
+#[cfg(unix)] pub use consts::os::posix88::{ENOTCONN, ECONNABORTED, EADDRNOTAVAIL, EINTR};
+#[cfg(unix)] pub use consts::os::posix88::{EADDRINUSE, ENOENT, EISDIR, EAGAIN, EWOULDBLOCK};
+#[cfg(unix)] pub use consts::os::posix88::{ECANCELED, SIGINT, EINPROGRESS};
+#[cfg(unix)] pub use consts::os::posix88::{SIGTERM, SIGKILL, SIGPIPE, PROT_NONE};
+#[cfg(unix)] pub use consts::os::posix01::{SIG_IGN, WNOHANG};
+#[cfg(unix)] pub use consts::os::bsd44::{AF_UNIX};
+
+#[cfg(unix)] pub use types::os::common::posix01::{pthread_t, timespec, timezone};
+
+#[cfg(unix)] pub use types::os::arch::posix88::{uid_t, gid_t};
+#[cfg(unix)] pub use types::os::arch::posix01::{pthread_attr_t};
+#[cfg(unix)] pub use types::os::arch::posix01::{stat, utimbuf};
+#[cfg(unix)] pub use funcs::posix88::unistd::{sysconf, setgid, setsid, setuid, pread, pwrite};
+#[cfg(unix)] pub use funcs::posix88::unistd::{getgid, getuid};
+#[cfg(unix)] pub use funcs::posix88::unistd::{_PC_NAME_MAX, utime, nanosleep, pathconf, link};
+#[cfg(unix)] pub use funcs::posix88::unistd::{chown};
+#[cfg(unix)] pub use funcs::posix88::mman::{mmap, munmap, mprotect};
+#[cfg(unix)] pub use funcs::posix88::dirent::{opendir, readdir_r, closedir};
+#[cfg(unix)] pub use funcs::posix88::fcntl::{fcntl};
+#[cfg(unix)] pub use funcs::posix01::stat_::{lstat};
+#[cfg(unix)] pub use funcs::posix01::unistd::{fsync, ftruncate};
+#[cfg(unix)] pub use funcs::posix01::unistd::{readlink, symlink};
+
+#[cfg(windows)] pub use consts::os::c95::{WSAECONNREFUSED, WSAECONNRESET, WSAEACCES};
+#[cfg(windows)] pub use consts::os::c95::{WSAEWOULDBLOCK, WSAENOTCONN, WSAECONNABORTED};
+#[cfg(windows)] pub use consts::os::c95::{WSAEADDRNOTAVAIL, WSAEADDRINUSE, WSAEINTR};
+#[cfg(windows)] pub use consts::os::c95::{WSAEINPROGRESS};
+#[cfg(windows)] pub use consts::os::extra::{ERROR_INSUFFICIENT_BUFFER};
+#[cfg(windows)] pub use consts::os::extra::{O_BINARY, O_NOINHERIT, PAGE_NOACCESS};
+#[cfg(windows)] pub use consts::os::extra::{PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE};
+#[cfg(windows)] pub use consts::os::extra::{PAGE_EXECUTE_READ, PAGE_EXECUTE_READWRITE};
+#[cfg(windows)] pub use consts::os::extra::{MEM_COMMIT, MEM_RESERVE, MEM_RELEASE};
+#[cfg(windows)] pub use consts::os::extra::{FILE_MAP_READ, FILE_MAP_WRITE, FILE_MAP_EXECUTE};
+#[cfg(windows)] pub use consts::os::extra::{ERROR_ALREADY_EXISTS, ERROR_NO_DATA};
+#[cfg(windows)] pub use consts::os::extra::{ERROR_FILE_NOT_FOUND, ERROR_INVALID_NAME};
+#[cfg(windows)] pub use consts::os::extra::{ERROR_BROKEN_PIPE, ERROR_INVALID_FUNCTION};
+#[cfg(windows)] pub use consts::os::extra::{TRUE, FALSE, INFINITE};
+#[cfg(windows)] pub use consts::os::extra::{PROCESS_TERMINATE, PROCESS_QUERY_INFORMATION};
+#[cfg(windows)] pub use consts::os::extra::{STILL_ACTIVE, DETACHED_PROCESS};
+#[cfg(windows)] pub use consts::os::extra::{CREATE_NEW_PROCESS_GROUP};
+#[cfg(windows)] pub use consts::os::extra::{FILE_BEGIN, FILE_END, FILE_CURRENT};
+#[cfg(windows)] pub use consts::os::extra::{FILE_GENERIC_READ, FILE_GENERIC_WRITE};
+#[cfg(windows)] pub use consts::os::extra::{FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE};
+#[cfg(windows)] pub use consts::os::extra::{TRUNCATE_EXISTING, CREATE_ALWAYS, OPEN_EXISTING};
+#[cfg(windows)] pub use consts::os::extra::{CREATE_NEW, FILE_APPEND_DATA, FILE_WRITE_DATA};
+#[cfg(windows)] pub use consts::os::extra::{OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL};
+#[cfg(windows)] pub use consts::os::extra::{FILE_FLAG_BACKUP_SEMANTICS, INVALID_HANDLE_VALUE};
+#[cfg(windows)] pub use consts::os::extra::{MOVEFILE_REPLACE_EXISTING};
+#[cfg(windows)] pub use consts::os::extra::{GENERIC_READ, GENERIC_WRITE};
+#[cfg(windows)] pub use consts::os::extra::{VOLUME_NAME_DOS, FILE_ATTRIBUTE_NORMAL};
+#[cfg(windows)] pub use consts::os::extra::{PIPE_ACCESS_DUPLEX, FILE_FLAG_FIRST_PIPE_INSTANCE};
+#[cfg(windows)] pub use consts::os::extra::{FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE};
+#[cfg(windows)] pub use consts::os::extra::{PIPE_READMODE_BYTE, PIPE_WAIT};
+#[cfg(windows)] pub use consts::os::extra::{PIPE_UNLIMITED_INSTANCES, ERROR_ACCESS_DENIED};
+#[cfg(windows)] pub use consts::os::extra::{FILE_WRITE_ATTRIBUTES, FILE_READ_ATTRIBUTES};
+#[cfg(windows)] pub use consts::os::extra::{ERROR_PIPE_BUSY, ERROR_IO_PENDING};
+#[cfg(windows)] pub use consts::os::extra::{ERROR_PIPE_CONNECTED, WAIT_OBJECT_0};
+#[cfg(windows)] pub use types::os::common::bsd44::{SOCKET};
+#[cfg(windows)] pub use types::os::common::posix01::{stat, utimbuf};
+#[cfg(windows)] pub use types::os::arch::extra::{HANDLE, BOOL, LPSECURITY_ATTRIBUTES};
+#[cfg(windows)] pub use types::os::arch::extra::{LPCSTR, WORD, DWORD, BYTE, FILETIME};
+#[cfg(windows)] pub use types::os::arch::extra::{LARGE_INTEGER, LPVOID, LONG};
+#[cfg(windows)] pub use types::os::arch::extra::{time64_t, OVERLAPPED, LPCWSTR};
+#[cfg(windows)] pub use types::os::arch::extra::{LPOVERLAPPED, SIZE_T, LPDWORD};
+#[cfg(windows)] pub use funcs::c95::string::{wcslen};
+#[cfg(windows)] pub use funcs::posix88::stat_::{wstat, wutime, wchmod, wrmdir};
+#[cfg(windows)] pub use funcs::bsd43::{closesocket};
+#[cfg(windows)] pub use funcs::extra::kernel32::{GetCurrentDirectoryW, GetLastError};
+#[cfg(windows)] pub use funcs::extra::kernel32::{GetEnvironmentVariableW, SetEnvironmentVariableW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{GetModuleFileNameW, SetCurrentDirectoryW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{GetSystemInfo, VirtualAlloc, VirtualFree};
+#[cfg(windows)] pub use funcs::extra::kernel32::{CreateFileMappingW, MapViewOfFile};
+#[cfg(windows)] pub use funcs::extra::kernel32::{UnmapViewOfFile, CloseHandle};
+#[cfg(windows)] pub use funcs::extra::kernel32::{WaitForSingleObject, GetSystemTimeAsFileTime};
+#[cfg(windows)] pub use funcs::extra::kernel32::{QueryPerformanceCounter};
+#[cfg(windows)] pub use funcs::extra::kernel32::{WaitForSingleObject, QueryPerformanceFrequency};
+#[cfg(windows)] pub use funcs::extra::kernel32::{GetExitCodeProcess, TerminateProcess};
+#[cfg(windows)] pub use funcs::extra::kernel32::{ReadFile, WriteFile, SetFilePointerEx};
+#[cfg(windows)] pub use funcs::extra::kernel32::{FlushFileBuffers, SetEndOfFile, CreateFileW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{CreateDirectoryW, FindFirstFileW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{FindNextFileW, FindClose, DeleteFileW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{GetFinalPathNameByHandleW, CreateSymbolicLinkW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{CreateHardLinkW, CreateEventW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{FlushFileBuffers, CreateNamedPipeW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{SetNamedPipeHandleState, WaitNamedPipeW};
+#[cfg(windows)] pub use funcs::extra::kernel32::{GetOverlappedResult, ConnectNamedPipe};
+#[cfg(windows)] pub use funcs::extra::kernel32::{DisconnectNamedPipe, OpenProcess};
+#[cfg(windows)] pub use funcs::extra::kernel32::{MoveFileExW, VirtualProtect};
+#[cfg(windows)] pub use funcs::extra::msvcrt::{get_osfhandle, open_osfhandle};
+
+#[cfg(target_os = "linux")] #[cfg(target_os = "android")] #[cfg(target_os = "freebsd")]
+pub use consts::os::posix01::{CLOCK_REALTIME, CLOCK_MONOTONIC};
+
+#[cfg(target_os = "linux")] #[cfg(target_os = "android")]
+pub use funcs::posix01::unistd::{fdatasync};
+
+#[cfg(unix, not(target_os = "freebsd"))]
+pub use consts::os::extra::{MAP_STACK};
+
+#[cfg(target_os = "freebsd")]
+pub use consts::os::bsd44::{TCP_KEEPIDLE};
+
+#[cfg(target_os = "macos")]
+pub use consts::os::bsd44::{TCP_KEEPALIVE};
+#[cfg(target_os = "macos")]
+pub use consts::os::extra::{F_FULLFSYNC};
+#[cfg(target_os = "macos")]
+pub use types::os::arch::extra::{mach_timebase_info};
+
+
 #[cfg(not(windows))]
 #[link(name = "c")]
 #[link(name = "m")]
@@ -225,8 +316,8 @@ pub mod c95 {
             */
             #[repr(u8)]
             pub enum c_void {
-                priv variant1,
-                priv variant2
+                __variant1,
+                __variant2,
             }
             pub enum FILE {}
             pub enum fpos_t {}
@@ -997,7 +1088,6 @@ pub mod posix08 {
             pub mod bsd44 {
             }
             pub mod extra {
-                use ptr;
                 use consts::os::extra::{MAX_PROTOCOL_CHAIN,
                                               WSAPROTOCOL_LEN};
                 use types::common::c95::c_void;
@@ -1102,24 +1192,6 @@ pub struct SYSTEM_INFO {
                 }
                 pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
 
-                impl SYSTEM_INFO {
-                    pub fn new() -> SYSTEM_INFO {
-                        SYSTEM_INFO {
-                            wProcessorArchitecture: 0,
-                            wReserved: 0,
-                            dwPageSize: 0,
-                            lpMinimumApplicationAddress: ptr::mut_null(),
-                            lpMaximumApplicationAddress: ptr::mut_null(),
-                            dwActiveProcessorMask: 0,
-                            dwNumberOfProcessors: 0,
-                            dwProcessorType: 0,
-                            dwAllocationGranularity: 0,
-                            wProcessorLevel: 0,
-                            wProcessorRevision: 0
-                        }
-                    }
-                }
-
                 pub struct MEMORY_BASIC_INFORMATION {
                     pub BaseAddress: LPVOID,
                     pub AllocationBase: LPVOID,
@@ -1150,8 +1222,8 @@ pub struct FILETIME {
 
                 pub struct GUID {
                     pub Data1: DWORD,
-                    pub Data2: DWORD,
-                    pub Data3: DWORD,
+                    pub Data2: WORD,
+                    pub Data3: WORD,
                     pub Data4: [BYTE, ..8],
                 }
 
@@ -1637,6 +1709,7 @@ pub mod bsd44 {
             pub static SO_KEEPALIVE: c_int = 8;
             pub static SO_BROADCAST: c_int = 32;
             pub static SO_REUSEADDR: c_int = 4;
+            pub static SO_ERROR: c_int = 0x1007;
 
             pub static SHUT_RD: c_int = 0;
             pub static SHUT_WR: c_int = 1;
@@ -2425,6 +2498,7 @@ pub mod bsd44 {
             pub static SO_KEEPALIVE: c_int = 9;
             pub static SO_BROADCAST: c_int = 6;
             pub static SO_REUSEADDR: c_int = 2;
+            pub static SO_ERROR: c_int = 4;
 
             pub static SHUT_RD: c_int = 0;
             pub static SHUT_WR: c_int = 1;
@@ -2883,6 +2957,7 @@ pub mod bsd44 {
             pub static SO_KEEPALIVE: c_int = 0x0008;
             pub static SO_BROADCAST: c_int = 0x0020;
             pub static SO_REUSEADDR: c_int = 0x0004;
+            pub static SO_ERROR: c_int = 0x1007;
 
             pub static SHUT_RD: c_int = 0;
             pub static SHUT_WR: c_int = 1;
@@ -3043,7 +3118,6 @@ pub mod posix88 {
             pub static MAP_PRIVATE : c_int = 0x0002;
             pub static MAP_FIXED : c_int = 0x0010;
             pub static MAP_ANON : c_int = 0x1000;
-            pub static MAP_STACK : c_int = 0;
 
             pub static MAP_FAILED : *c_void = -1 as *c_void;
 
@@ -3270,6 +3344,7 @@ pub mod bsd44 {
             pub static SO_KEEPALIVE: c_int = 0x0008;
             pub static SO_BROADCAST: c_int = 0x0020;
             pub static SO_REUSEADDR: c_int = 0x0004;
+            pub static SO_ERROR: c_int = 0x1007;
 
             pub static SHUT_RD: c_int = 0;
             pub static SHUT_WR: c_int = 1;
@@ -3289,6 +3364,7 @@ pub mod extra {
             pub static MAP_HASSEMAPHORE : c_int = 0x0200;
             pub static MAP_NOCACHE : c_int = 0x0400;
             pub static MAP_JIT : c_int = 0x0800;
+            pub static MAP_STACK : c_int = 0;
         }
         pub mod sysconf {
             use types::os::arch::c95::c_int;
@@ -3901,12 +3977,11 @@ pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int)
         pub mod glob {
             use types::os::arch::c95::{c_char, c_int};
             use types::os::common::posix01::{glob_t};
-            use Nullable;
 
             extern {
                 pub fn glob(pattern: *c_char,
                             flags: c_int,
-                            errfunc: Nullable<extern "C" fn(epath: *c_char, errno: int) -> int>,
+                            errfunc: ::Nullable<extern "C" fn(epath: *c_char, errno: int) -> int>,
                             pglob: *mut glob_t);
                 pub fn globfree(pglob: *mut glob_t);
             }