We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25c8466 commit 71e2ffcCopy full SHA for 71e2ffc
1 file changed
druntime/src/core/sys/posix/dirent.d
@@ -441,6 +441,26 @@ else
441
static assert(false, "Unsupported platform");
442
}
443
444
+//
445
+// POSIX.1-2008
446
447
+/*
448
+int dirfd(DIR*);
449
+*/
450
+version (NetBSD)
451
+{
452
+ // On NetBSD, this is a macro in dirent.h, not a function.
453
+ extern (D) int dirfd()(DIR* dir) nothrow @nogc
454
+ {
455
+ // ABI guarantees dd_fd remains the first field
456
+ return *(cast(int*) dir);
457
+ }
458
+}
459
+else
460
461
+ nothrow @nogc int dirfd(DIR* dir);
462
463
+
464
// Only OS X out of the Darwin family needs special treatment. Other Darwins
465
// (iOS, TVOS, WatchOS) are fine with normal symbol names for these functions
466
// in else below.
0 commit comments