Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 7e48091

Browse files
committed
Sync with dlang/PR/2001
1 parent f1c440c commit 7e48091

File tree

11 files changed

+94
-165
lines changed

11 files changed

+94
-165
lines changed

src/core/sys/posix/dirent.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ else version( DragonFlyBSD )
155155
DT_LNK = 10,
156156
DT_SOCK = 12,
157157
DT_WHT = 14,
158-
DT_DBF = 15, /* database record file */
158+
DT_DBF = 15, /* database record file */
159159
}
160160

161161
struct dirent

src/core/sys/posix/fcntl.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ else version( DragonFlyBSD )
417417
enum F_SETOWN = 6;
418418
enum F_GETLK = 7;
419419
// enum F_SETLK = 8;
420-
enum F_SETLK = 8;
420+
enum F_SETLK = 8;
421421
enum F_SETLKW = 9;
422422
enum F_OGETLK = F_GETLK;
423423
enum F_OSETLK = F_SETLK;

src/core/sys/posix/netdb.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ else version( DragonFlyBSD )
431431
int ai_flags;
432432
int ai_family;
433433
int ai_socktype = SOCK_STREAM; /* socktype default value required to be able to perform getAddrInfo on DragonFlyBSD
434-
* without socktype set, you get 'servname not supported for ai_socktype'
435-
*/
434+
* without socktype set, you get 'servname not supported for ai_socktype'
435+
*/
436436
int ai_protocol;
437437
socklen_t ai_addrlen;
438438
char* ai_canonname;

src/core/sys/posix/pthread.d

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,13 @@ else version( DragonFlyBSD )
214214
enum
215215
{
216216
PTHREAD_DETACHED = 0x1,
217+
//PTHREAD_SCOPE_SYSTEM = 0x2, // defined below
217218
PTHREAD_INHERIT_SCHED = 0x4,
218219
PTHREAD_NOFLOAT = 0x8,
219220

220221
PTHREAD_CREATE_DETACHED = PTHREAD_DETACHED,
221222
PTHREAD_CREATE_JOINABLE = 0,
223+
//PTHREAD_SCOPE_PROCESS = 0, // defined below
222224
PTHREAD_EXPLICIT_SCHED = 0,
223225
}
224226

@@ -242,8 +244,8 @@ else version( DragonFlyBSD )
242244
enum PTHREAD_DONE_INIT = 1;
243245

244246
enum PTHREAD_MUTEX_INITIALIZER = null;
245-
enum PTHREAD_ONCE_INIT = null;
246-
enum PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP = null;
247+
//enum PTHREAD_ONCE_INIT = { PTHREAD_NEEDS_INIT, NULL };
248+
enum PTHREAD_ONCE_INIT = pthread_once_t.init;;
247249
enum PTHREAD_COND_INITIALIZER = null;
248250
enum PTHREAD_RWLOCK_INITIALIZER = null;
249251
}
@@ -402,8 +404,6 @@ else version( FreeBSD )
402404
}
403405
else version( DragonFlyBSD )
404406
{
405-
alias void function(void*) _pthread_cleanup_routine;
406-
407407
struct _pthread_cleanup_info
408408
{
409409
uintptr_t[8] pthread_cleanup_pad;
@@ -575,6 +575,9 @@ else version( FreeBSD )
575575
else version( DragonFlyBSD )
576576
{
577577
enum PTHREAD_BARRIER_SERIAL_THREAD = -1;
578+
enum PTHREAD_KEYS_MAX = 256;
579+
enum PTHREAD_STACK_MIN = 16384;
580+
enum PTHREAD_THREADS_MAX = c_ulong.max;
578581

579582
int pthread_barrier_destroy(pthread_barrier_t*);
580583
int pthread_barrier_init(pthread_barrier_t*, in pthread_barrierattr_t*, uint);
@@ -1006,7 +1009,6 @@ else version( DragonFlyBSD )
10061009
int pthread_attr_setscope(in pthread_attr_t*, int);
10071010
int pthread_getschedparam(pthread_t, int*, sched_param*);
10081011
int pthread_setschedparam(pthread_t, int, sched_param*);
1009-
//int pthread_setschedprio(pthread_t, int); // not implemented
10101012
}
10111013
else version (Solaris)
10121014
{

src/core/sys/posix/pwd.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ else version( DragonFlyBSD )
9999
char* pw_dir; /* home directory */
100100
char* pw_shell; /* default shell */
101101
time_t pw_expire; /* account expiration */
102-
int pw_fields; /* internal: fields filled in */
102+
int pw_fields; /* internal: fields filled in */
103103
}
104104
}
105105
else version (Solaris)

src/core/sys/posix/setjmp.d

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,7 @@ else version( FreeBSD )
173173
else version( DragonFlyBSD )
174174
{
175175
// <machine/setjmp.h>
176-
version( X86 )
177-
{
178-
enum _JBLEN = 11;
179-
struct _jmp_buf { int[_JBLEN + 1] _jb; }
180-
}
181-
else version( X86_64)
176+
version( X86_64)
182177
{
183178
enum _JBLEN = 12;
184179
struct _jmp_buf { c_long[_JBLEN] _jb; }
@@ -261,11 +256,7 @@ else version( FreeBSD )
261256
else version( DragonFlyBSD )
262257
{
263258
// <machine/setjmp.h>
264-
version( X86 )
265-
{
266-
struct _sigjmp_buf { int[_JBLEN + 1] _ssjb; }
267-
}
268-
else version( X86_64)
259+
version( X86_64)
269260
{
270261
struct _sigjmp_buf { c_long[_JBLEN] _sjb; }
271262
}

src/core/sys/posix/signal.d

Lines changed: 33 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ version( Solaris )
114114
alias _sigrtmin SIGRTMIN;
115115
alias _sigrtmax SIGRTMAX;
116116
}
117+
else version (DragonFlyBSD) {
118+
enum SIGRTMIN = 35;
119+
enum SIGRTMAX = 126;
120+
}
117121
else version( Posix )
118122
{
119123
private extern (C) nothrow @nogc
@@ -894,6 +898,7 @@ else version( FreeBSD )
894898
}
895899
else version( DragonFlyBSD )
896900
{
901+
enum SIG_CATCH = cast(sigfn_t2) 2;
897902
enum SIG_HOLD = cast(sigfn_t2) 3;
898903

899904
struct sigset_t
@@ -912,51 +917,21 @@ else version( DragonFlyBSD )
912917
int si_signo;
913918
int si_errno;
914919
int si_code;
915-
pid_t si_pid;
916-
uid_t si_uid;
920+
int si_pid;
921+
uint si_uid;
917922
int si_status;
918923
void* si_addr;
919924
sigval si_value;
920-
union __reason
921-
{
922-
struct __fault
923-
{
924-
int _trapno;
925-
}
926-
__fault _fault;
927-
struct __timer
928-
{
929-
int _timerid;
930-
int _overrun;
931-
}
932-
__timer _timer;
933-
struct __mesgq
934-
{
935-
int _mqd;
936-
}
937-
__mesgq _mesgq;
938-
struct __poll
939-
{
940-
c_long _band;
941-
}
942-
__poll _poll;
943-
struct ___spare___
944-
{
945-
c_long __spare1__;
946-
int[7] __spare2__;
947-
}
948-
___spare___ __spare__;
949-
}
950-
__reason _reason;
951-
952-
@property ref c_long si_band() return { return _reason._poll._band; }
925+
c_long si_band;
926+
int[7] __spare;
953927
}
954928

955-
enum SI_USER = 0x10001;
956-
enum SI_QUEUE = 0x10002;
957-
enum SI_TIMER = 0x10003;
958-
enum SI_ASYNCIO = 0x10004;
959-
enum SI_MESGQ = 0x10005;
929+
enum SI_UNDEFINED = 0x00000;
930+
enum SI_USER = 0;
931+
enum SI_QUEUE = -1;
932+
enum SI_TIMER = -2;
933+
enum SI_ASYNCIO = -3;
934+
enum SI_MESGQ = -4;
960935

961936
int kill(pid_t, int);
962937
int sigaction(int, in sigaction_t*, sigaction_t*);
@@ -1767,7 +1742,7 @@ else version( DragonFlyBSD )
17671742
SS_DISABLE = 0x0004,
17681743
}
17691744

1770-
enum MINSIGSTKSZ = 512 * 4;
1745+
enum MINSIGSTKSZ = 8192;
17711746
enum SIGSTKSZ = (MINSIGSTKSZ + 32768);
17721747
;
17731748
//ucontext_t (defined in core.sys.posix.ucontext)
@@ -2273,21 +2248,25 @@ else version( FreeBSD )
22732248
}
22742249
else version( DragonFlyBSD )
22752250
{
2251+
union _sigev_un_t
2252+
{
2253+
int sigev_signo;
2254+
int sigev_notify_kqueue;
2255+
void /*pthread_attr_t*/ * sigev_notify_attributes;
2256+
};
2257+
union _sigval_t
2258+
{
2259+
int sival_int;
2260+
void * sival_ptr;
2261+
int sigval_int;
2262+
void * sigval_ptr;
2263+
};
22762264
struct sigevent
22772265
{
2278-
int sigev_notify;
2279-
int sigev_signo;
2280-
sigval sigev_value;
2281-
union _sigev_un
2282-
{
2283-
lwpid_t _threadid;
2284-
struct _sigev_thread
2285-
{
2286-
void function(sigval) _function;
2287-
void* _attribute;
2288-
}
2289-
c_long[8] __spare__;
2290-
}
2266+
int sigev_notify;
2267+
_sigev_un_t sigev_un;
2268+
_sigval_t sigev_value;
2269+
void function(_sigval_t) sigev_notify_function;
22912270
}
22922271

22932272
int sigqueue(pid_t, int, in sigval);

src/core/sys/posix/sys/socket.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ else version( DragonFlyBSD )
936936
{
937937
SOCK_STREAM = 1,
938938
SOCK_DGRAM = 2,
939-
//SOCK_RAW = 3, // defined below
939+
//SOCK_RAW = 3, // defined below
940940
SOCK_RDM = 4,
941941
SOCK_SEQPACKET = 5,
942942
}
@@ -1021,7 +1021,7 @@ else version( DragonFlyBSD )
10211021
AF_ISDN = 26,
10221022
AF_E164 = AF_ISDN,
10231023
pseudo_AF_KEY = 27,
1024-
//AF_INET6 = 28, // defined below
1024+
//AF_INET6 = 28, // defined below
10251025
AF_NATM = 29,
10261026
AF_ATM = 30,
10271027
pseudo_AF_HDRCMPLT = 31,

src/core/sys/posix/sys/stat.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -788,12 +788,12 @@ else version( DragonFlyBSD )
788788
uid_t st_uid; /* user ID of the file's owner */
789789
gid_t st_gid; /* group ID of the file's group */
790790
dev_t st_rdev; /* device type */
791-
time_t st_atime;
792-
c_long __st_atimensec;
793-
time_t st_mtime;
794-
c_long __st_mtimensec;
795-
time_t st_ctime;
796-
c_long __st_ctimensec;
791+
time_t st_atime;
792+
c_long __st_atimensec;
793+
time_t st_mtime;
794+
c_long __st_mtimensec;
795+
time_t st_ctime;
796+
c_long __st_ctimensec;
797797
off_t st_size; /* file size, in bytes */
798798
int64_t st_blocks; /* blocks allocated for file */
799799
uint32_t st_blksize; /* optimal blocksize for I/O */

src/core/sys/posix/syslog.d

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -204,62 +204,60 @@ else version( FreeBSD )
204204
}
205205
else version( DragonFlyBSD )
206206
{
207-
//http://fxr.watson.org/fxr/source/sys/syslog.h
208-
209207
//PRIORITY
210208
enum {
211-
LOG_EMERG = 0, /* system is unusable */
212-
LOG_ALERT = 1, /* action must be taken immediately */
213-
LOG_CRIT = 2, /* critical conditions */
214-
LOG_ERR = 3, /* error conditions */
215-
LOG_WARNING = 4, /* warning conditions */
216-
LOG_NOTICE = 5, /* normal but significant condition */
217-
LOG_INFO = 6, /* informational */
218-
LOG_DEBUG = 7, /* debug-level messages */
209+
LOG_EMERG = 0, /* system is unusable */
210+
LOG_ALERT = 1, /* action must be taken immediately */
211+
LOG_CRIT = 2, /* critical conditions */
212+
LOG_ERR = 3, /* error conditions */
213+
LOG_WARNING = 4, /* warning conditions */
214+
LOG_NOTICE = 5, /* normal but significant condition */
215+
LOG_INFO = 6, /* informational */
216+
LOG_DEBUG = 7, /* debug-level messages */
219217
};
220218

221219
//OPTIONS
222220
enum {
223-
LOG_PID = 0x01, /* log the pid with each message */
224-
LOG_CONS = 0x02, /* log on the console if errors in sending */
225-
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
226-
LOG_NDELAY = 0x08, /* don't delay open */
227-
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
228-
LOG_PERROR = 0x20, /* log to stderr as well */
221+
LOG_PID = 0x01, /* log the pid with each message */
222+
LOG_CONS = 0x02, /* log on the console if errors in sending */
223+
LOG_ODELAY = 0x04, /* delay open until first syslog() (default) */
224+
LOG_NDELAY = 0x08, /* don't delay open */
225+
LOG_NOWAIT = 0x10, /* don't wait for console forks: DEPRECATED */
226+
LOG_PERROR = 0x20, /* log to stderr as well */
229227
};
230228

231229
//FACILITY
232230
enum {
233-
LOG_KERN = (0<<3), /* kernel messages */
234-
LOG_USER = (1<<3), /* random user-level messages */
235-
LOG_MAIL = (2<<3), /* mail system */
236-
LOG_DAEMON = (3<<3), /* system daemons */
237-
LOG_AUTH = (4<<3), /* security/authorization messages */
238-
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
239-
LOG_LPR = (6<<3), /* line printer subsystem */
240-
LOG_NEWS = (7<<3), /* network news subsystem */
241-
LOG_UUCP = (8<<3), /* UUCP subsystem */
242-
LOG_CRON = (9<<3), /* clock daemon */
243-
LOG_AUTHPRIV = (10<<3), /* security/authorization messages (private), */
244-
LOG_FTP = (11<<3), /* ftp daemon */
245-
LOG_NTP = (12<<3), /* NTP subsystem */
246-
LOG_SECURITY = (13<<3), /* security subsystems (firewalling, etc.) */
247-
LOG_CONSOLE = (14<<3), /* /dev/console output */
231+
LOG_KERN = (0<<3), /* kernel messages */
232+
LOG_USER = (1<<3), /* random user-level messages */
233+
LOG_MAIL = (2<<3), /* mail system */
234+
LOG_DAEMON = (3<<3), /* system daemons */
235+
LOG_AUTH = (4<<3), /* security/authorization messages */
236+
LOG_SYSLOG = (5<<3), /* messages generated internally by syslogd */
237+
LOG_LPR = (6<<3), /* line printer subsystem */
238+
LOG_NEWS = (7<<3), /* network news subsystem */
239+
LOG_UUCP = (8<<3), /* UUCP subsystem */
240+
LOG_CRON = (9<<3), /* clock daemon */
241+
LOG_AUTHPRIV= (10<<3), /* security/authorization messages (private), */
242+
LOG_FTP = (11<<3), /* ftp daemon */
243+
LOG_NTP = (12<<3), /* NTP subsystem */
244+
LOG_SECURITY= (13<<3), /* security subsystems (firewalling, etc.) */
245+
LOG_CONSOLE = (14<<3), /* /dev/console output */
248246

249247
/* other codes through 15 reserved for system use */
250-
LOG_LOCAL0 = (16<<3), /* reserved for local use */
251-
LOG_LOCAL1 = (17<<3), /* reserved for local use */
252-
LOG_LOCAL2 = (18<<3), /* reserved for local use */
253-
LOG_LOCAL3 = (19<<3), /* reserved for local use */
254-
LOG_LOCAL4 = (20<<3), /* reserved for local use */
255-
LOG_LOCAL5 = (21<<3), /* reserved for local use */
256-
LOG_LOCAL6 = (22<<3), /* reserved for local use */
257-
LOG_LOCAL7 = (23<<3), /* reserved for local use */
248+
LOG_LOCAL0 = (16<<3), /* reserved for local use */
249+
LOG_LOCAL1 = (17<<3), /* reserved for local use */
250+
LOG_LOCAL2 = (18<<3), /* reserved for local use */
251+
LOG_LOCAL3 = (19<<3), /* reserved for local use */
252+
LOG_LOCAL4 = (20<<3), /* reserved for local use */
253+
LOG_LOCAL5 = (21<<3), /* reserved for local use */
254+
LOG_LOCAL6 = (22<<3), /* reserved for local use */
255+
LOG_LOCAL7 = (23<<3), /* reserved for local use */
258256

259257
LOG_NFACILITIES = 24, /* current number of facilities */
260258
};
261259

262-
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
260+
int LOG_MASK(int pri) { return 1 << pri; } /* mask for one priority */
263261
int LOG_UPTO(int pri) { return (1 << (pri+1)) - 1; } /* all priorities through pri */
264262

265263
void openlog (const char *, int __option, int __facility);

0 commit comments

Comments
 (0)