Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions druntime/src/core/sys/posix/dirent.d
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,26 @@ else
static assert(false, "Unsupported platform");
}

//
// POSIX.1-2008
//
/*
int dirfd(DIR*);
*/
version (NetBSD)
{
// On NetBSD, this is a macro in dirent.h, not a function.
extern (D) int dirfd()(DIR* dir) nothrow @nogc
{
// ABI guarantees dd_fd remains the first field
return *(cast(int*) dir);
}
}
else
{
nothrow @nogc int dirfd(DIR* dir);
Comment thread
ibuclaw marked this conversation as resolved.
}

// Only OS X out of the Darwin family needs special treatment. Other Darwins
// (iOS, TVOS, WatchOS) are fine with normal symbol names for these functions
// in else below.
Expand Down
Loading