Welcome to the FoFPC Run-Time Library BaseUnix
Base Unix Functionality
uses
UnixType; // Basic Unix Types
Overview
The BaseUnix unit contains basic unix functionality. It supersedes
the Linux unit of version 1.0.X of the compiler, but does not
implement all functionality of the linux unit.
People that have code which heavily uses the old Linux unit, can simply
change linux by oldlinux in the uses clause of their projects, but they
should really consider moving to the Unix and BaseUnix units.
For porting FPC to new unix-like platforms, it should be sufficient to
implement the functionality in this unit for the new platform.
Methods
CreateShellArgV
Create a null-terminated array of strings from a command-line string
FpAccess
Check file access
FpAlarm
Schedule an alarm signal to be delivered
FpChdir
Change current working directory
FpChmod
Change file permission bits
FpChown
Change owner of file
FpClose
Close file descriptor
FpClosedir
Close directory file descriptor
FpDup
Duplicate a file handle
FpDup2
Duplicate one filehandle to another
FpExecv
Execute process
FpExecve
Execute process using environment
FpExit
Exit the current process
FpFcntl
File control operations
fpfdfillset
Set all filedescriptors in the set
fpFD_CLR
Clears a filedescriptor in a set
fpFD_ISSET
Check whether a filedescriptor is set
fpFD_SET
Set a filedescriptor in a set
fpFD_ZERO
Clear all file descriptors in set
FpFork
Create child process
FPFStat
Retrieve file information about a file descriptor
FpFtruncate
Truncate file on certain size
FpGetcwd
Retrieve the current working directory
FpGetegid
Return effective group ID
FpGetEnv
Return value of environment variable
fpgeterrno
Retrieve extended error information
FpGeteuid
Return effective user ID
FpGetgid
Return real group ID
FpGetgroups
Get the list of supplementary groups
FpGetpgrp
Get process group ID
FpGetpid
Return current process ID
FpGetppid
Return parent process ID
fpGetPriority
Return process priority
FpGetuid
Return current user ID
FpIOCtl
General kernel IOCTL call
FpKill
Send a signal to a process
FpLink
Create a hard link to a file
FpLseek
Set file pointer position
fpLstat
Return information about symbolic link. Does not follow the link
FpMkdir
Create a new directory
FpMkfifo
Create FIFO (named pipe) in file system
Fpmmap
Create memory map of a file
Fpmunmap
Unmap previously mapped memory block
FpNanoSleep
Suspend process for a short time
fpNice
Set process priority
FpOpen
Open file and return file descriptor
FpOpendir
Open a directory for reading
FpPause
Wait for a signal to arrive
FpPipe
Create a set of pipe file handlers
FppRead
Positional read: read from file descriptor at a certain position
FppWrite
Positional write: write to file descriptor at a certain position
FpRead
Read data from file descriptor
FpReaddir
Read entry from directory
fpReadLink
Read destination of symbolic link
FpReadV
Vector read: Read into multiple buffers
FpRename
Rename file
FpRmdir
Remove a directory
fpSelect
Wait for events on file descriptors
fpseterrno
Set extended error information
FpSetgid
Set the current group ID
fpSetPriority
Set process priority
FpSetsid
Create a new session
fpsettimeofday
Set kernel time
FpSetuid
Set the current user ID
FPSigaction
Install signal handler
FpSigAddSet
Set a signal in a signal set
FpSigDelSet
Remove a signal from a signal set
FpsigEmptySet
Clear all signals from signal set
FpSigFillSet
Set all signals in signal set
FpSigIsMember
Check whether a signal appears in a signal set
FpSignal
Install signal handler (deprecated)
FpSigPending
Return set of currently pending signals
FpSigProcMask
Set list of blocked signals
FpSigSuspend
Set signal mask and suspend process till signal is received
FpSleep
Suspend process for several seconds
FpStat
Retrieve file information about a file descriptor
fpSymlink
Create a symbolic link
fpS_ISBLK
Is file a block device
fpS_ISCHR
Is file a character device
fpS_ISDIR
Is file a directory
fpS_ISFIFO
Is file a FIFO
fpS_ISLNK
Is file a symbolic link
fpS_ISREG
Is file a regular file
fpS_ISSOCK
Is file a unix socket
fptime
Return the current unix time
FpTimes
Return execution times for the current process
FpUmask
Set file creation mask
FpUname
Return system name
FpUnlink
Unlink (i.e. remove) a file
FpUtime
Set access and modification times of a file (touch)
FpWait
Wait for a child to exit
FpWaitPid
Wait for a process to terminate
FpWrite
Write data to file descriptor
FpWriteV
Vector write: Write from multiple buffers to a file descriptor
FreeShellArgV
Free the result of a CreateShellArgV function
wexitStatus
Extract the exit status from the fpWaitPID result
wifexited
Check whether the process exited normally
wifsignaled
Check whether the process was exited by a signal
wstopsig
Return the exit code from the process
wtermsig
Return the signal that caused a process to exit
Constants
ARG_MAX = UnixType.ARG_MAX
Maximum number of arguments to a program
BITSINWORD = 8 * SizeOf(cuLong)
Number of bits in a word
ESysE2BIG = 7
System error: Argument list too long; used when the arguments passed to a new program being executed with one of the exec functions occupy too much memory space
ESysEACCES = 13
System error: Permission denied; the file permissions do not allow the attempted operation
ESysEADDRINUSE = 98
System error: Address already in use; The requested socket address is already in use
ESysEADDRNOTAVAIL = 99
System error: Cannot assign requested address; for example, you tried to give a socket a name that doesn't match the local host name
ESysEADV = 68
System error: Advertise error
ESysEAFNOSUPPORT = 97
System error: Address family not supported by protocol; The address family specified for a socket is not supported; it is inconsistent with the protocol being used on the socket
ESysEAGAIN = 11
System error: Try again; Resource temporarily unavailable; the call might work if you try again later. Only fork returns error code EAGAIN for such a reason
ESysEALREADY = 114
System error: Operation already in progress; An operation is already in progress on an object that has non-blocking mode selected
ESysEBADE = 52
System error: Invalid exchange
ESysEBADF = 9
System error: Bad file number; Bad file descriptor; for example, I/O on a descriptor that has been closed or reading from a descriptor open only for writing (or vice versa)
ESysEBADFD = 77
System error: File descriptor in bad state; This should be returned when you try to use a syscall that takes a FD, and you have passed it a FD that is not open
ESysEBADMSG = 74
System error: Not a data message; The linux kernel itself appears to never generate this error message. POSIX Standard: During a read(2), getmsg(2), getpmsg(2), or ioctl(2) I_RECVFD request to a STREAMS device, a message arrived at the head of the STREAM that is inappropriate for the function receiving the message. read(2) Message waiting to be read on a STREAM is not a data message
ESysEBADR = 53
System error: Invalid request descriptor;
ESysEBADRQC = 56
System error: Invalid request code
ESysEBADSLT = 57
System error: Invalid slot
ESysEBFONT = 59
System error: Bad font file format
ESysEBUSY = 16
System error: Device or resource busy; a system resource that can't be shared is already in use. For example, if you try to delete a file that is the root of a currently mounted filesystem, you get this error
ESysECHILD = 10
System error: No child processes; This error happens on operations that are supposed to manipulate child processes, when there aren't any processes to manipulate
ESysECHRNG = 44
System error: Channel number out of range
ESysECOMM = 70
System error: Communication error on send
ESysECONNABORTED = 103
System error: Software caused connection abort; A network connection was aborted locally
ESysECONNREFUSED = 111
System error: Connection refused; A remote host refused to allow the network connection (typically because it is not running the requested service)
ESysECONNRESET = 104
System error: Connection reset by peer; A network connection was closed for reasons outside the control of the local host, such as by the remote machine rebooting
ESysEDEADLK = 35
System error: Resource deadlock would occur; Deadlock avoided; allocating a system resource would have resulted in a deadlock situation. For an example, File Locks. Try again at a later time or free the resources which would have deadlocked
ESysEDEADLOCK = 58
System error: File locking deadlock error; Newer Kernels define EDEADLOCK = EDEADLK (58 had been released for new assignment)
ESysEDESTADDRREQ = 89
System error: Destination address required; No destination address was supplied on a socket operation
ESysEDOM = 33
System error: Math argument out of domain of function; used by mathematical functions when an argument value does not fall into the domain over which the function is defined
ESysEDOTDOT = 73
System error: RFS specific error
ESysEDQUOT = 122
System error: Quota exceeded; The user's disk quota was exceeded
ESysEEXIST = 17
System error: File exists; An existing file specified in an inappropriate context; for instance, as the new directory name in a mkdir() function
ESysEFAULT = 14
System error: Bad address; an invalid pointer was detected
ESysEFBIG = 27
System error: File too large; the size of a file would be larger than allowed by the system
ESysEHOSTDOWN = 112
System error: Host is down; The remote host for a requested network connection is down
ESysEHOSTUNREACH = 113
System error: No route to host; The remote host for a requested network connection is not reachable
ESysEIDRM = 43
System error: Identifier removed; The System V IPC resource ID used has been removed. Use an allocated IPC resource
ESysEILSEQ = 84
System error: Illegal byte sequence; An illegal multibyte sequence was found in the input. This usually means that you have the wrong charactor encoding, for instance the MicrosoftCorporation version of latin-1 (aka iso_8859_1(7)) (which has it's own stuff like "smart quotes" in the reserved bytes) instead of the real latin (or perhaps utf8(7))
ESysEINPROGRESS = 115
System error: Operation now in progress; An operation that cannot complete immediately was initiated on an object that has non-blocking mode selected
ESysEINTR = 4
System error: Interrupted system call; an asynchronous signal occured and prevented completion of the call. When this happens, you should try the call again
ESysEINVAL = 22
System error: Invalid argument; This is used to indicate various kinds of problems with passing the wrong argument to a library function
ESysEIO = 5
System error: I/O error; Input/output error; usually used for physical read or write errors
ESysEISCONN = 106
System error: Transport endpoint is already connected; You tried to connect a socket that is already connected
ESysEISDIR = 21
System error: Is a directory; File is a directory; attempting to open a directory for writing gives this error
ESysEISNAM = 120
System error: Is a named type file
ESysEL2HLT = 51
System error: Level 2 halted
ESysEL2NSYNC = 45
System error: Level 2 not synchronized
ESysEL3HLT = 46
System error: Level 3 halted
ESysEL3RST = 47
System error: Level 3 reset
ESysELIBACC = 79
System error: Can not access a needed shared library
ESysELIBBAD = 80
System error: Accessing a corrupted shared library
ESysELIBEXEC = 83
System error: Cannot exec a shared library directly
ESysELIBMAX = 82
System error: Attempting to link in too many shared libraries
ESysELIBSCN = 81
System error: .lib section in a.out corrupted
ESysELNRNG = 48
System error: Link number out of range
ESysELOOP = 40
System error: Too many symbolic links encountered in looking up a file name. This often indicates a cycle of symbolic links
ESysEMFILE = 24
System error: Too many open files; The current process has too many files open and can't open any more. Duplicate descriptors do count toward this limit
ESysEMLINK = 31
System error: Too many links; the link count of a single file or directory is too large. The exact number allowed is file-system dependent (sysv_fs.h). This could be caused by a directory having too many subdirectories (each subdirectory has .. as a hardlink to it's parent directory which causes that directory's hardlink count to be increased by one. So yes, this does mean that you are limited to 32000 subdirectories in one directory in ext3, even if you have hashdirs enabled.) As a consequence of this you can stat(2) a directory and add one (for ..) and you will know how many directories are in the current directory. (or subtract one (for .) to find out how many subdirectories there are). Some file systems (such as FAT) don't have hardlinks so the hardlink count can't overflow, and you can't rely on the hardlink count of a directory to be representive of how many subdirectories it has
ESysEMSGSIZE = 90
System error: Message too long; The size of a message sent on a socket was larger than the supported maximum size
ESysEMULTIHOP = 72
System error: Multihop attempted; Components of path require hopping to multiple remote machines and file system type does not allow it. This error occurs when users try to access remote resources that are not directly accessible
ESysENAMETOOLONG = 36
System error: File name too long; Filename too long (longer than PATH_MAX {4096 bytes}) or host name too long {103 bytes} (in gethostname or sethostname)
ESysENAVAIL = 119
System error: No XENIX semaphores available
ESysENETDOWN = 100
System error: Network is down; A socket operation failed because the network was down. This error usually means you are using an interface that has since been taken down. Check that the interface you are trying to use is up
ESysENETRESET = 102
System error: Network dropped connection because of reset
ESysENETUNREACH = 101
System error: Network is unreachable; A socket operation failed because the subnet containing the remost host was unreachable. You will get this error if you try to connect(2) a socket(2) to a host, and a router between you and that host believes the host is unreachable. It would then send ICMP_DEST_UNREACH, which would find its way back to you eventually. You would also see this instantly if for example your local machine knew it had no route to the destination host
ESysENFILE = 23
System error: File table overflow; There are too many distinct file openings in the entire system. Note that any number of linked channels count as just one file opening. The system has reached the maximum number of files it will allow to be open at once system wide. This is usually caused by a runaway process or group of processes. For example a cron job that runs a program but that program never exiting will eventually either run the system out of memory, out of processes, or out of files. lsof(8), fuser(1) etc can be used to try and determine what is using the files and killing the offending processes. Also, you can up the system wide number of files by putting a larger number into /proc/sys/fs/file-max, you will probably have to update /proc/sys/fs/inode-max too (maximum number of open inodes)
Under Solaris this limit can be increased by setting maxusers in /etc/system. To make a change of /etc/system effective, a reboot is necessary
ESysENOANO = 55
System error: No anode
ESysENOBUFS = 105
System error: No buffer space available; The kernel's buffers for I/O operations are all in use. The kernel is out of memory. If this happens on a FreeBSD machine increase the number of mbuf's. Alternatively, wait a bit and try again later. Not to be confused with EAGAIN which means that the buffer for one resource is used (eg: the write buffer on a TCP connection), this means all of the buffers are in use
ESysENOCSI = 50
System error: No CSI structure available; Links between structures are invalid. Occurs while checking file system integrity and repairing file system. If an indirect block is not valid, issue ENOCSI and the file is not processed
ESysENODATA = 61
System error: No data available; It looks like this error condition is supposed to be used if a read(2) system call is used on a file descriptor in non-blocking mode and no data is ready to be read. However, according to the read(2) man page for the GNU C library, EAGAIN is used in this situation instead. ENODATA is used in the linux kernel in a few places, however. For example:
- the NTFS and the JFS drivers use it as an error condition in a few places
- The "Intel CPU Microcode Update driver for Linux" uses this error code
- The ftape driver returns this on an ECC read failure
ESysENODEV = 19
System error: No such device; The wrong type of device was given to a function that expects a particular sort of device. The device you are trying to access doesn't exist, or the drivers for this device aren't loaded. This can occur if you refer to a file in /dev that has no driver loaded for it, or when loading a driver if no hardware exists. It is also quite common to see this under linux if you try to load a device driver and the driver can't find the corresponding hardware (for example, you've given the driver the wrong options)
ESysENOENT = 2
System error: No such file or directory; This is a "file doesn't exist" error for ordinary files that are referenced in contexts where they are expected to already exist. This can happen when creating a file if one of the parent directories doesn't exist
ESysENOEXEC = 8
System error: Executable format error; Invalid executable file format. This condition is detected by the exec functions. The most common format for binary programs under linux is called ELF
ESysENOLCK = 37
System error: No record locks available; This is used by the file locking facilities. This often happens on NFS if rpc.lockd(8) isn't running
ESysENOLINK = 67
System error: Link has been severed; Linux source uses it in a few places for what appears to be networking related (eg: the network card has no link). Man pages around the Internet imply that it's a filesystem error -- the file could not be found because a link to the remote host is down
ESysENOMEM = 12
System error: Out of memory; The system cannot allocate more virtual memory because its capacity is full. This almost certainly means that one or more programs on your machine has gone out of control and has used up all of the virtual memory (physical and swap) on the machine
ESysENOMSG = 42
System error: No message of desired type
ESysENONET = 64
System error: Machine is not on the network
ESysENOPKG = 65
System error: Package not installed; The feature you are trying to use is not available -- perhaps it requires a kernel recompilation
ESysENOPROTOOPT = 92
System error: Protocol not available; You specified a socket option that doesn't make sense for the particular protocol being used by the socket
ESysENOSPC = 28
System error: No space left on device; write operation on a file failed because the disk is full. Note that by default, on ext3 partitions, normal users cannot use up 100% of the disk space. 5% is reserved for root, so root has space to bzip2 files, move things around etc. This 5% margin also lowers the amount of fragmentation that occurs on a filesystem. This may mean that even though your partition may not be totally full yet, programs will complaing about being out of space. Depending on your tools, they may say that "100%" of the disk is full at this 5% margin (and therefore you can have up to 105% of the disk being used), or they may only say 95%. These settings can be changed with tune2fs(8). Linux offers a convenience for testing how code reacts to a full device in the form of /dev/full, a device which returns ENOSPC for any attempt to write to it
ESysENOSR = 63
System error: Out of streams resources
ESysENOSTR = 60
System error: Device not a stream
ESysENOSYS = 38
System error: Function not implemented; Some functions have commands or options defined that might not be supported in all implementations, and this is the kind of error you get if you request them and they are not supported
ESysENOTBLK = 15
System error: Block device required; A file that isn't a block special file was given in a situation that requires one. For example, trying to mount an ordinary file (or a character device) as a file system in Unix gives this error
ESysENOTCONN = 107
System error: Transport endpoint is not connected; The socket is not connected to anything. You get this error when you try to transmit data over a socket, without first specifying a destination for the data
ESysENOTDIR = 20
System error: Not a directory; A file that isn't a directory was specified when a directory is required. This more frequently (and confusingly) occurs when you are refering to a file, where you would expect a file to work, but the directory path is wrong, like an element of the path is actually a filename.
ESysENOTEMPTY = 39
System error: Directory not empty; where an empty directory was expected. Typically, this error occurs when you are trying to delete a directory. Before you can remove a directory, you must remove (unlink(2)) all files from that directory first. Note, even if the directory looks empty, remember to check for hidden files (the ones that start with ".")
ESysENOTNAM = 118
System error: Not a XENIX named type file
ESysENOTSOCK< = 88/dt>
System error: Socket operation on non-socket; A file descriptor that isn't a socket was specified when a socket is required. Socket's are created with the socket(2) syscall
ESysENOTTY = 25
System error: Not a typewriter; Inappropriate I/O control operation, such as trying to set terminal modes on an ordinary file. This often occurs in shell scripts that want to use stty(1) to configure the terminal, but are being run from crond(8)? or perhaps your .profile when you're logging in using something that doesn't create a terminal (eg: issuing a remote command using ssh(1))
ESysENOTUNIQ = 76
System error: Name not unique on network
ESysENXIO = 6
System error: No such device or address; Typically, this means that a file representing a device has been installed incorrectly, and the system can't find the right kind of device driver for it. O_NONBLOCK | O_WRONLY is set, the named file is a FIFO and no process has the file open for reading. Or, the file is a device special file and no corresponding device exists
ESysEOPNOTSUPP = 95
System error: Operation not supported on transport endpoint; Some socket functions don't make sense for all types of sockets, and others may not be implemented for all communications protocols. This usually occurs if you are trying to accept(2) a non SOCK_STREAM socket
ESysEOVERFLOW = 75
System error: Value too large for defined data type; Returned when an application that can only handle small files (due to the version of libc it was compiled against), tries to access a large (>2g) file
ESysEPERM = 1
System error: Operation not permitted; only the owner of the file (or other resource) or processes with special privileges can perform the operation. This appears to be regularly confused with EACCES. EACCES is for permission based while EPERM is when trying to break a rule. For example, trying to erase a file on a read-only file system, trying to change nice when not a superuser, changing setpriority on a process that does not belong to you
ESysEPFNOSUPPORT = 96
System error: Protocol family not supported; the socket communications protocol family you requested is not supported
ESysEPIPE = 32
System error: Broken pipe; there is no process reading from the other end of a pipe. Every library function that returns this error code also generates a SIGPIPE signal; this signal terminates the program if not handled or blocked. Thus, your program will never actually see EPIPE unless it has handled or blocked SIGPIPE
ESysEPROTO = 71
System error: Protocol error; the protocol encountered an unrecoverable error for that endpoint. EPROTO is one of those catch-all error codes used by STREAMS-based drivers when a better code isn't available. On some STREAMS-based implementations, EPROTO could be returned by accept(2) if the incoming connection was reset before the accept completes
ESysEPROTONOSUPPORT = 93
System error: Protocol not supported; The socket domain does not support the requested communications protocol
ESysEPROTOTYPE = 91
System error: Protocol wrong type for socket; The socket type does not support the requested communications protocol
ESysERANGE = 34
System error: Math result not representable; used by mathematical functions when the result value is not representable because of overflow or underflow. This error number is also returned for example in gethostbyname_r (the re-entrant version of gethostbyname(3)) if the buffer given to the function is too small to store "auxiliary data"
ESysEREMCHG = 78
System error: Remote address changed
ESysEREMOTE = 66
System error: Object is remote; An attempt was made to NFS-mount a remote file system with a file name that already specifies an NFS-mounted file
ESysEREMOTEIO = 121
System error: Remote I/O error
ESysERESTART = 85
System error: Interrupted system call should be restarted
ESysEROFS = 30
System error: Read-only file system; An attempt was made to modify a file on a read-only file system
ESysESHUTDOWN = 108
System error: Cannot send after transport endpoint shutdown; The socket has already been shut down. shutdown(2) has been called on a socket to close down the sending end of the transmision, and then data was attempted to be sent
ESysESOCKTNOSUPPORT = 94
System error: Socket type not supported
ESysESPIPE = 29
System error: Illegal seek; Invalid seek operation (such as on Pipes, FIFO's, NamedPipes?, TTY's and socket(7)'s are all objects which aren't seekable, they are just linear streams of bytes
ESysESRCH = 3
System error: No such process; No process matches the specified process ID.It's also used for other things that don't exist in the filesystem not being found too, for instance, if you try and delete a route from the routing table and that route doesn't exist, you'll get a confusing "Process not found" message
ESysESRMNT = 69
System error: Srmount error
ESysESTALE = 116
System error: Stale NFS file handle; This indicates an internal confusion in the NFS system which is due to file system rearrangements on the server host. Repairing this condition usually requires unmounting and remounting the NFS file system on the local host. This occurs on an NFS client machine when you try and access a file that no longer exists on the server. Since NFS is a stateless protocol, the server cannot tell if a client has a file open, so when it is unlink(2)'d and a NFS client has recently used the file it appears as .nfsXXXXXXX for a short time, after which it is expired and removed from the disk. Any further attempts to access this file from a NFS client will result in "Stale NFS Handle"
ESysESTRPIPE = 86
System error: Streams pipe error
ESysETIME = 62
System error: Timer expired
ESysETIMEDOUT = 110
System error: Connection timed out; A socket operation with a specified timeout received no response during the timeout period
ESysETOOMANYREFS = 109
System error: Too many references: cannot splice
ESysETXTBSY = 26
System error: Text (code segment) file busy; An attempt to execute a file that is currently open for writing, or write to a file that is currently being executed. (The name stands for "text file busy".) This cannot occur on MicrosoftWindows since it refers to a file by name, thus you cannot remove a file that is in use in Windows
ESysEUCLEAN = 117
System error: Structure needs cleaning; returned inside the smbfs code, which appears to me to be related to if you access a share that has no medium (eg: an empty floppy drive) you'll get this error
ESysEUNATCH = 49
System error: Protocol driver not attached
ESysEUSERS = 87
System error: Too many users; The file quota system is confused because there are too many users
ESysEWOULDBLOCK = ESysEAGAIN = 11
System error: Operation would block; An operation that would block was attempted on an object that has non-blocking mode selected
ESysEXDEV = 18
System error: Cross-device link; An attempt to make an improper link across file systems was detected. Since inode numbers are only unique on the filesystem that they exist, you cannot create a HardLink across a filesystem boundary
ESysEXFULL = 54
System error: Exchange full
FD_MAXFDSET = 1024
Maximum elements in a TFDSet array
FPE_FLTDIV = 3
Value signalling floating point divide by zero in case of SIGFPE signal
FPE_FLTINV = 7
Value signalling floating point invalid operation in case of SIGFPE signal
FPE_FLTOVF = 4
Value signalling floating point overflow in case of SIGFPE signal
FPE_FLTRES = 6
Value signalling floating point inexact result in case of SIGFPE signal
FPE_FLTSUB = 8
Value signalling floating point subscript out of range in case of SIGFPE signal
FPE_FLTUND = 5
Value signalling floating point underflow in case of SIGFPE signal
FPE_INTDIV = 1
Value signalling integer divide in case of SIGFPE signal
FPE_INTOVF = 2
Value signalling integer overflow in case of SIGFPE signal
F_GetFd = 1
fpFCntl command: Get close-on-exec flag
F_GetFl = 3
fpFCntl command: Get filedescriptor flags
F_GetLk = 5
fpFCntl command: Get lock
F_GetOwn = 9
fpFCntl command: get owner of filedescriptor events
F_OK = 0
fpAccess call test: file exists
F_SetFd = 2
fpFCntl command: Set close-on-exec flag
F_SetFl = 4
fpFCntl command: Set filedescriptor flags
F_SetLk = 6
fpFCntl command: Set lock
F_SetLkW = 7
fpFCntl command: Test lock
F_SetOwn = 8
fpFCntl command: Set owner of filedescriptor events
ln2bitmask = 1 shl ln2bitsinword - 1
Last bit in word.
MAP_ANON = MAP_ANONYMOUS = $20
Anonymous memory mapping (data private to application)
MAP_ANONYMOUS = $20
FpMMap map type: Don't use a file
MAP_FAILED = Pointer(-1)
Memory mapping failed error code
MAP_FIXED = $10
FpMMap map type: Interpret addr exactly
MAP_PRIVATE = $2
FpMMap map type: Changes are private
MAP_SHARED = $1
FpMMap map type: Share changes
MAP_TYPE = $F
FpMMap map type: Bitmask for type of mapping
NAME_MAX = UnixType.NAME_MAX
Maximum filename length
O_APPEND = $400
fpOpen file open mode: Append to file
O_CREAT = $40
fpOpen file open mode: Create if file does not yet exist.
O_DIRECT = $4000
fpOpen file open mode: Minimize caching effects
O_DIRECTORY = $10000
fpOpen file open mode: File must be directory.
O_EXCL = $80
fpOpen file open mode: Open exclusively
O_NDELAY = O_NONBLOCK = $8000
fpOpen file open mode: Alias for O_NonBlock
O_NOCTTY = $100
fpOpen file open mode: No TTY control.
O_NOFOLLOW = $20000
fpOpen file open mode: Fail if file is symbolic link.
O_NONBLOCK = $8000
fpOpen file open mode: Open in non-blocking mode
O_RDONLY = $0
fpOpen file open mode: Read only
O_RDWR = $2
fpOpen file open mode: Read/Write
O_SYNC = $1000
fpOpen file open mode: Write to disc at once
O_TRUNC = $200
fpOpen file open mode: Truncate file to length 0
O_WRONLY = $1
fpOpen file open mode: Write only
PATH_MAX = UnixType.PATH_MAX
Maximum pathname length.
PRIO_PGRP = UnixType.PIO_PGRP
Easy access alias for unixtype.PRIO_PGRP
PRIO_PROCESS = UnixType.PRIO_PROCESS
Easy access alias for unixtype.PRIO_PROCESS
PRIO_USER = UnixType.PRIO_USER
Easy access alias for unixtype.PRIO_USER
PROT_EXEC = $4
FpMMap memory access: page can be executed
PROT_NONE = $0
FpMMap memory access: page can not be accessed
PROT_READ = $1
FpMMap memory access: page can be read
PROT_WRITE = $2
FpMMap memory access: page can be written
RLIMIT_AS = 9
RLimit request address space limit
RLIMIT_CORE = 4
RLimit request max core file size
RLIMIT_CPU = 0
RLimit request CPU time in ms
RLIMIT_DATA = 2
RLimit request max data size
RLIMIT_FSIZE = 1
Rlimit request maximum filesize
RLIMIT_LOCKS = 10
RLimit request maximum file locks held
RLIMIT_MEMLOCK = 8
RLimit request max locked-in-memory address space
RLIMIT_NOFILE = 7
RLimit request max number of open files
RLIMIT_NPROC = 6
RLimit request max number of processes
RLIMIT_RSS = 5
RLimit request max resident set size
RLIMIT_STACK = 3
RLimit request max stack size
R_OK = 4
fpAccess call test: read allowed
SA_INTERRUPT = $20000000
Sigaction options: (Not Portable) For Older Kernels, newer this is a default
SA_NOCLDSTOP = 1
Sigaction options: If signum is SIGCHLD, do not receive notification when child processes stop (i.e., when they receive one of SIGSTOP, SIGTSTP, SIGTTIN or SIGTTOU) or resume (i.e., they receive SIGCONT) (see wait(2)). This flag is only meaningful when establishing a handler for SIGCHLD. If this bit is set when installing a catching function for the SIGCHLD signal, the SIGCHLD signal will be generated only when a child process exits, not when a child process stops
SA_NOCLDWAIT = 2
Sigaction options: If signum is SIGCHLD, do not transform children into zombies when they terminate. See also waitpid(2). This flag is only meaningful when establishing a handler for SIGCHLD, or when setting that signal’s disposition to SIG_DFL. If the SA_NOCLDWAIT flag is set when establishing a handler for SIGCHLD, POSIX.1 leaves it unspecified whether a SIGCHLD signal is generated when a child process terminates. On Linux, a SIGCHLD signal is generated in this case; on some other implementations, it is not
SA_NODEFER = $40000000
Sigaction options: Do not prevent the signal from being received from within its own signal handler. This flag is only meaningful when establishing a signal handler. SA_NOMASK is an obsolete, non-standard synonym for this flag
SA_NOMASK = SA_NODEFER = $40000000
Sigaction options: Do not prevent the signal from being received when it is handled
SA_ONESHOT = SA_RESETHAND = $80000000
Sigaction options: Restore the signal action to the default state
SA_ONSTACK = $08000000
Sigaction options: Call the signal handler on an alternate signal stack provided by sigaltstack(2). If an alternate stack is not available, the default stack will be used. This flag is only meaningful when establishing a signal handler
SA_RESETHAND = $80000000
Sigaction options: Restore the signal action to the default state once the signal handler has been called. This flag is only meaningful when establishing a signal handler. SA_ONESHOT is an obsolete, non-standard synonym for this flag
SA_RESTART = $10000000
Sigaction options: If a signal is caught during the system calls listed below, the call may be forced to terminate with the error EINTR, the call may return with a data transfer shorter than requested, or the call may be restarted. Restart of pending calls is requested by setting the SA_RESTART bit in sa_flags. The affected system calls include open(2), read(2), write(2), sendto(2), recvfrom(2), sendmsg(2) and recvmsg(2) on a communications channel or a slow device (such as a terminal, but not a regular file) and during a wait(2) or ioctl(2). However, calls that have already committed are not restarted, but instead return a partial success (for example, a short read count)
SA_RESTORER = $04000000
Sigaction options: Signal restorer handler
SA_SIGINFO = 4
Sigaction options: The signal handler takes 3 arguments, not one. In this case, sa_sigaction should be set instead of sa_handler. This flag is only meaningful when establishing a signal handler.
SEEK_CUR = 1
fpLSeek option: Set position relative to current position
SEEK_END = 2
fpLSeek option: Set position relative to end of file
SEEK_SET = 0
fpLSeek option: Set absolute position
SIGABRT = 6
Signal: ABRT (Abort)
SIGALRM = 14
Signal: ALRM (Alarm clock)
SIGBUS = 7
Signal: BUS (bus error)
SIGCHLD = 17
Signal: CHLD (child status changed)
SIGCONT = 18
Signal: CONT (Continue)
SIGFPE = 8
Signal: FPE (Floating point error)
SIGHUP = 1
Signal: HUP (Hangup)
SIGILL = 4
Signal: ILL (Illegal instruction)
SIGINT = 2
Signal: INT (Interrupt)
SIGIO = 29
Signal: IO (I/O operation possible)
SIGIOT = 6
Signal: IOT (IOT trap)
SIGKILL = 9
Signal: KILL (unblockable)
SIGPIPE = 13
Signal: PIPE (Broken pipe)
SIGPOLL = SIGIO = 29
Signal: POLL (Pollable event)
SIGPROF = 27
Signal: PROF (Profiling alarm)
SIGPWR = 30
Signal: PWR (power failure restart)
SIGQUIT = 3
Signal: QUIT
SIGSEGV = 11
Signal: SEGV (Segmentation violation)
SIGSTKFLT = 16
Signal: STKFLT (Stack Fault)
SIGSTOP = 19
Signal: STOP (Stop, unblockable)
SIGTERM = 15
Signal: TERM (Terminate)
SIGTRAP = 5
Signal: TRAP (Trace trap)
SIGTSTP = 20
Signal: TSTP (keyboard stop)
SIGTTIN = 21
Signal: TTIN (Terminal input, background)
SIGTTOU = 22
Signal: TTOU (Terminal output, background)
SIGUNUSED = 31
Signal: Unused
SIGURG = 23
Signal: URG (Socket urgent condition)
SIGUSR1 = 10
Signal: USR1 (User-defined signal 1)
SIGUSR2 = 12
Signal: USR2 (User-defined signal 2)
SIGVTALRM = 26
Signal: VTALRM (Virtual alarm clock)
SIGWINCH = 28
Signal: WINCH (Window/Terminal size change)
SIGXCPU = 24
Signal: XCPU (CPU limit exceeded)
SIGXFSZ = 25
Signal: XFSZ (File size limit exceeded)
SIG_BLOCK = 0
Sigprocmask flags: Add signals to the set of blocked signals.
SIG_DFL = 0
Signal handler: Default signal handler
SIG_ERR = -1
Signal handler: error
SIG_IGN = 1
Signal handler: Ignore signal
SIG_MAXSIG = UnixType.SIG_MAXSIG
Maximum system signal number
SIG_SETMASK = 2
Sigprocmask flags: Set of blocked signals is given
SIG_UNBLOCK = 1
Sigprocmask flags: Remove signals from the set of blocked signals
SI_PAD_SIZE = ((128 div SizeOf(LongInt))-3)
Signal information pad size
SYS_NMLN = UnixType.SYS_NMLN
Max system name length
S_IFBLK = 24576
File (#rtl.baseunix.stat record) mode: Block device
S_IFCHR = 8192
File (#rtl.baseunix.stat record) mode: Character device
S_IFDIR = 16384
File (#rtl.baseunix.stat record) mode: Directory
S_IFIFO = 4096
File (#rtl.baseunix.stat record) mode: FIFO
S_IFLNK = 40960
File (#rtl.baseunix.stat record) mode: Link
S_IFMT = 61440
File (#rtl.baseunix.stat record) mode: File type bit mask
S_IFREG = 32768
File (#rtl.baseunix.stat record) mode: Regular file
S_IFSOCK = 49152
File (#rtl.baseunix.stat record) mode: Socket
S_IRGRP = %0000100000
Mode flag: Read by group
S_IROTH = %0000000100
Mode flag: Read by others
S_IRUSR = %0100000000
Mode flag: Read by owner
S_IRWXU = S_IRUSR or S_IWUSR or S_IXUSR
Mode flag: Read, write, execute by user
S_IWGRP = %0000010000
Mode flag: Write by group
S_IWOTH = %0000000010
Mode flag: Write by others
S_IWUSR = %0010000000
Mode flag: Write by owner
S_IXGRP = %0000001000
Mode flag: Execute by group
S_IXOTH = %0000000001
Mode flag: Execute by others
S_IXUSR = %0001000000
Mode flag: Execute by owner
UTSNAME_DOMAIN_LENGTH = UTSNAME_LENGTH
Max length of utsname domain name
UTSNAME_LENGTH = SYS_NMLN
Max length of utsname system name, release, version, machine
UTSNAME_NODENAME_LENGTH = UTSNAME_LENGTH
Max length of utsname node name
WNOHANG = 1
#rtl.baseunix.fpWaitpid option: Do not wait for processes to terminate
wordsinfdset = FD_MAXFDSET div BITSINWORD
Number of words in a TFDSet array
wordsinsigset = SIG_MAXSIG div BITSINWORD
Number of words in a signal set.
WUNTRACED = 2
#rtl.baseunix.fpWaitpid option: Also report children wich were stopped but not yet reported
W_OK = 2
fpAccess call test: write allowed
X_OK = 1
fpAccess call test: execute allowed
Types and Structures
pthread_fastlock = Record
Blkcnt64_t = cuint64
64-bit block count
Blkcnt_t = cuint
Block count type
Blksize_t = cuint
Block size type
cbool = longbool
Boolean type
cchar = cint8
Alias for #rtl.UnixType.cchar
cdouble = double
Double precision real format.
cfloat = single
Floating-point real format
cint = cint32
C type: integer (natural size)
cint16 = smallint
C type: 16 bits sized, signed integer
cint32 = longint
C type: 32 bits sized, signed integer
cint64 = int64
C type: 64 bits sized, signed integer
cint8 = shortint
C type: 8 bits sized, signed integer
clock_t = culong (64Bit:cuint64)
Clock ticks type
clong = longint (64Bit:int64)
C type: long signed integer (double sized)
clongdouble = extended
Long double
clonglong = cuint64
C type: 64-bit (double long) signed integer.
cschar = cint8
Signed character type
cshort = cint16
C type: short signed integer (half sized)
csigned = cint
Signed integer
csint = cint32
Signed integer
cslong = int64
Signed long
cslonglong = cint64
Signed longlong type
csshort = cint16
Short signed integer type
cuchar = cuint8
Alias for #rtl.UnixType.cuchar
cuint = cuint32
C type: unsigned integer (natural size)
cuint16 = word
C type: 16 bits sized, unsigned integer
cuint32 = longword
C type: 32 bits sized, unsigned integer
cuint64 = qword
C type: 64 bits sized, unsigned integer
cuint8 = byte
C type: 8 bits sized, unsigned integer
culong = cardinal (64Bit:qword)
C type: long unsigned integer (double sized)
culonglong = cuint64
C type: 64-bit (double long) unsigned integer
cunsigned = cuint
Alias for #rtl.unixtype.cunsigned
cushort = cuint16
C type: short unsigned integer (half sized)
dev_t = cuint64
Device descriptor type
Dir = Record
Record used in fpOpenDir and fpReadDir calls
Dirent = Record
Record used in the fpReadDir function to return files in a directory
FLock = Record
Lock description type for fpFCntl lock call
gid_t = cuint32
Group ID type
ino_t = clong
Inode type
iovec = Record
IO buffer structure
ipc_pid_t = cushort (64Bit:cint)
mbstate_t = Record
mbstate_value_t = Record
mode_t = cuint32
Inode mode type
nlink_t = cuint32
Number of links type
off_t = cint32
Offset type
PBlkCnt
pointer to TBlkCnt type
PBlkSize
Pointer to TBlkSize type
pcbool
Pointer to boolean type
pcchar
Alias for #rtl.UnixType.pcchar
pcdouble
Pointer to cdouble type
pcfloat
Pointer to cfloat type
pcint
Pointer to cInt type
pcint16
Pointer to 16-bit signed integer type
pcint32
Pointer to signed 32-bit integer type
pcint64
Pointer to signed 64-bit integer type
pcint8
Pointer to 8-bits signed integer type
pClock
Pointer to TClock type
pclong
Pointer to cLong type
pclongdouble
Pointer to long double
pclonglong
Pointer to longlong type
pcschar
Pointer to signed character type
pcshort
Pointer to cShort type
pcsigned
Pointer to signed integer
pcsint
Pointer to signed integer
pcslong
Pointer to signed long
pcslonglong
Pointer to Signed longlong type
pcsshort
Pointer to short signed integer type
pcuchar
Alias for #rtl.UnixType.pcuchar
pcuint
Pointer to cUInt type
pcuint16
Pointer to 16-bit unsigned integer type
pcuint32
Pointer to unsigned 32-bit integer type
pcuint64
Pointer to unsigned 64-bit integer type
pcuint8
Pointer to 8-bits unsigned integer type
pculong
Pointer to cuLong type
pculonglong
Unsigned longlong type
pcunsigned
Alias for #rtl.unixtype.pcunsigned
pcushort
Pointer to cuShort type
pDev
Pointer to TDev type
pDir
Pointer to TDir record
pDirent
Pointer to TDirent record
pFDSet
Pointer to TFDSet type
pFilDes
Pointer to TFilDes type
pfpstate
Pointer to tfpstate record
pGid
Pointer to TGid type
pGrpArr
Pointer to TGrpArr array
pid_t = cint
Process ID type
pIno
Pointer to TIno type
piovec
pointer to a iovec record
pMode
Pointer to TMode type
pnLink
Pointer to TnLink type
pOff
Pointer to TOff type
pPid
Pointer to TPid type
PRLimit
Pointer to TRLimit record
psigactionrec
Pointer to SigActionRec record type
PSigContext
Pointer to #rtl.baseunix.TSigContext record type
psiginfo
Pointer to #rtl.baseunix.TSigInfo record type
psigset
Pointer to SigSet type
pSize
Pointer to TSize type
pSize_tn
Pointer to TSockLen type
psSize
Pointer to TsSize type
PStat
Pointer to TStat type
pthread_attr_t = Record
pthread_cond_t = Record
Thread conditional variable type
pthread_condattr_t = Record
pthread_key_t = Record
pthread_mutex_t = Record
Thread mutex type
pthread_mutexattr_t = Record
pthread_rwlock_t = Record
pthread_rwlockattr_t = Record
pthread_t = culong
Posix thread type
pTime
Pointer to TTime type
ptimespec
Pointer to timespec type
ptimeval
Pointer to timeval type
ptimezone
Pointer to TimeZone record
ptime_t
Pointer to time_t type
PTms
Pointer to TTms type
Pucontext
Pointer to TUContext type
pUid
Pointer to TUid type
pUtimBuf
Pointer to TUTimBuf type
PUtsName
Pointer to TUtsName type
rlim_t = cuLong
TRLimit record field type
sched_param = record
sem_t = Record
sigactionhandler
Callback prototype for a #rtl.baseunix.SigActionRec record
sigactionhandler_t
Standard signal action handler prototype
sigactionrec
Record used in fpSigAction call
signalhandler
Simple signal handler prototype
signalhandler_t
Standard signal handler prototype
sigrestorerhandler
Alias for sigrestorerhandler_t type
sigrestorerhandler_t
Standard signal action restorer prototype
sigset
Signal set type
sigset_t
Signal set type
size_t = cuint32 (64bit:cuint64)
Size specification type
socklen_t = cuint32
Socket address length type
ssize_t = cuint32 (64bit:cuint64)
Small size type.
Stat
Record describing an inode (file) in the FPFstat call
TBlkCnt
Alias for Blkcnt_t type
TBlkSize
Alias for blksize_t type
TClock
Alias for clock_t type
TDev
Alias for dev_t type
TDir
Alias for Dir type
TDirent
Alias for Dirent type
TFDSet = Array [0..(FD_MAXSET div BITSINWORD)-1] of cuLong
File descriptor set for fpSelect call
TFilDes
Array of file descriptors as used in fpPipe call
tfpreg
Record describing floating point register in signal handler
tfpstate
Record describing floating point unit in signal handler
TGid
Alias for gid_t type
TGrpArr
Array of gid_t IDs
timespec = packed Record
Short time specification type
timeval = packed Record
Time specification type
timezone = packed Record
Record describing a timezone
time_t = clong (64bit:cint64)
Time span type
TIno
Alias for ino_t type
TIOCtlRequest = cint
Easy access alias for unixtype.TIOCtlRequest
tiovec
Alias for the iovec record type
TMode
Alias for mode_t type
tms = packed Record
Record containing timings for fpTimes call
TnLink
Alias for nlink_t type
TOff
Alias for off_t type
TPid
Alias for pid_t type
TRLimit = Record
Structure to return RLimit data in
tsigactionhandler
Alias for sigactionhandler_t type
tsigaltstack
Provide the location of an alternate signal handler stack
TSigContext
Record describing the CPU context when a signal occurs
tsiginfo
Record describing the signal when a signal occurs
tsignalhandler
Alias for signalhandler_t type
tsigrestorerhandler
Alias for sigrestorerhandler_t type
tsigset
Alias for SigSet type
TSize
Alias for size_t type
TSocklen
Alias for socklen_t type
TsSize
Alias for ssize_t type
TStat
Alias for Stat type
tstatfs = packed Record
Record describing a file system in the baseunix.fpstatfs call
TTime
Alias for TTime type
Ttimespec
Alias for TimeSpec type
TTimeVal
Alias for timeval type
TTimeZone
Alias for TimeZone record
TTms
Alias for Tms record type
TUcontext
Context description record
TUid
Alias for uid_t type
TUtimBuf
Alias for UtimBuf type
TUtsName
Alias for UtsName type
uid_t = cuint32
User ID type
UTimBuf = Record
Record used in fpUtime to set file access and modificaton times
UtsName = Record
Record used to return kernel information in fpUName function
wchar_t = cint32
wint_t = cint32
Classes
There are not any classes globally defined in this unit.
Global Variables
There are not any variables globally defined in this unit.
grat-i-fi-ca-tion - noun
the state of being gratified; great satisfaction.
"Your research documents are head on ... I look forward to seeing more notes on your research."
Brian Ellixson
FreePascal User