diff options
author | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-12-07 20:27:02 +0000 |
---|---|---|
committer | marco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2014-12-07 20:27:02 +0000 |
commit | fadef90a73c47485d07aa106df8ddf7a9e27d70d (patch) | |
tree | eb89b97fcb2eb2d851b713f27f9431db00ab7dd4 /rtl/bsd | |
parent | 0f3186451885435c81d7d561af0d05f915cb48ef (diff) | |
download | fpc-fadef90a73c47485d07aa106df8ddf7a9e27d70d.tar.gz |
* first dragonfly patch (existing most). Mantis #27091
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@29213 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/bsd')
-rw-r--r-- | rtl/bsd/ostypes.inc | 60 | ||||
-rw-r--r-- | rtl/bsd/sysctl.pp | 2 | ||||
-rw-r--r-- | rtl/bsd/sysos.inc | 2 |
3 files changed, 49 insertions, 15 deletions
diff --git a/rtl/bsd/ostypes.inc b/rtl/bsd/ostypes.inc index 97d8923cb1..ab7395e77a 100644 --- a/rtl/bsd/ostypes.inc +++ b/rtl/bsd/ostypes.inc @@ -63,6 +63,30 @@ TYPE { file characteristics services } stat = record { the types are real} +{$ifdef dragonfly} + st_ino : ino_t; // inode's number + st_nlink : nlink_t; // number of hard links + st_dev : dev_t; // inode's device + st_mode : mode_t; // inode protection mode + st_padd1 : cuint16; + st_uid : uid_t; // user ID of the file's owner + st_gid : gid_t; // group ID of the file's group + st_rdev : dev_t; // device type + st_atime : time_t; // time of last access (half timespec) + st_atimensec : clong; // nsec of last access (half timespec) + st_mtime : time_t; // time of last data modification + st_mtimensec : clong; // nsec of last data modification + st_ctime : time_t; // time of last file status change + st_ctimensec : clong; // nsec of last file status change + st_size : off_t; // file size, in bytes + st_blocks : cint64; // blocks allocated for file + st_blksize : cuint32; // optimal blocksize for I/O + st_flags : cuint32; // user defined flags for file + st_gen : cuint32; // file generation number + st_lspare : cint32; + st_qspare1 : cint64; // was recursive change detect + st_qspare2 : cint64; +{$else dragonfly} st_dev : dev_t; // inode's device {$ifdef darwinarm} st_mode : mode_t; // inode protection mode @@ -114,6 +138,7 @@ TYPE st_birthtimensec : clong; // nsec of file creation time {$endif} st_qspare : array[0..1] Of cint64; +{$endif dragonfly} end; TStat = stat; pStat = ^stat; @@ -221,7 +246,7 @@ CONST O_APPEND = 8; { Writes append to the file. } O_NONBLOCK = 4; { Non-blocking I/O. } -{$ifdef freebsd} +{$if defined(freebsd) or defined(dragonfly)} { Other } O_SHLOCK = $10; { Open with shared file lock } O_EXLOCK = $20; { Open with exclusive file lock } @@ -269,6 +294,13 @@ CONST F_SetLkW = 13; { F_SETLK; wait if blocked } F_SetLkRemote = 14; { debugging support for remote locks } {$endif} +{$ifdef dragonfly} + F_GetLk = 7; { get record locking information} + F_SetLk = 8; { set record locking information } + F_SetLkW = 9; { F_SETLK; wait if blocked } + F_Dup2Fd = 10; { duplicate file descriptor to arg } + F_DupFd_CloExec = 17; { close on exec duplicated fd } +{$endif} {$ifdef netbsd} F_GetLk = 7; { get record locking information} F_SetLk = 8; { set record locking information } @@ -358,19 +390,18 @@ type // #define ru_last ru_nivcsw // #define ru_first ru_ixrss -{ auto generated by a c prog, statmacr.c} Const - S_IFMT = 61440; - S_IFIFO = 4096; - S_IFCHR = 8192; - S_IFDIR = 16384; - S_IFBLK = 24576; - S_IFREG = 32768; - S_IFLNK = 40960; - S_IFSOCK= 49152; - S_IFWHT = 57344; - S_ISVTX = 512; + S_IFMT = &170000; + S_IFIFO = &10000; + S_IFCHR = &20000; + S_IFDIR = &40000; + S_IFBLK = &60000; + S_IFREG = &100000; + S_IFLNK = &120000; + S_IFSOCK= &140000; + S_IFWHT = &160000; + S_ISVTX = &1000; { * Resource limits from FreeBSD5. To be checked for the others. @@ -384,7 +415,7 @@ Const RLIMIT_MEMLOCK = 6; { locked-in-memory address space } RLIMIT_NPROC = 7; { number of processes } RLIMIT_NOFILE = 8; { number of open files } -{$IFDEF FreeBSD} +{$if defined(freebsd) or defined(dragonfly)} RLIMIT_SBSIZE = 9; { maximum size of all socket buffers } RLIMIT_VMEM =10; { virtual process size (inclusive of mmap) } RLIMIT_AS = RLIMIT_VMEM; @@ -395,6 +426,9 @@ Const {$ifdef FreeBSD} RLIM_NLIMITS =11; { number of resource limits } {$endif} + {$ifdef dragonfly} + RLIM_NLIMITS =12; { number of resource limits } + {$endif} {$ifdef Darwin} // OS X 10.3 RLIM_NLIMITS =9; { number of resource limits } diff --git a/rtl/bsd/sysctl.pp b/rtl/bsd/sysctl.pp index 8a63b4234f..6eeddd327b 100644 --- a/rtl/bsd/sysctl.pp +++ b/rtl/bsd/sysctl.pp @@ -97,7 +97,7 @@ Uses Syscall; {$ENDIF} {$ifndef FPC_USE_LIBC} -{$ifdef FreeBSD} +{$if defined(FreeBSD) or defined(DragonFly)} CONST syscall_nr___sysctl = 202; {$endif} diff --git a/rtl/bsd/sysos.inc b/rtl/bsd/sysos.inc index c06f36e98f..cd0be3b717 100644 --- a/rtl/bsd/sysos.inc +++ b/rtl/bsd/sysos.inc @@ -22,7 +22,7 @@ const clib = 'c'; type libcint=longint; plibcint=^libcint; -{$ifdef FreeBSD} // tested on x86 +{$if defined(FreeBSD) or defined(DragonFly)} // tested on x86 function geterrnolocation: Plibcint; cdecl;external clib name '__error'; {$else} {$ifdef NetBSD} // from a sparc dump. |