extern"C"int __fcntl(int fd, int cmd, ...); extern"C"int __fcntl64(int, int, ...);
int fcntl(int fd, int cmd, ...) {
va_list args;
va_start(args, cmd); // This is a bit sketchy for LP64, especially because arg can be an int, // but all of our supported 64-bit ABIs pass the argument in a register. void* arg = va_arg(args, void*);
va_end(args);
if (cmd == F_SETFD && (reinterpret_cast<uintptr_t>(arg) & ~FD_CLOEXEC) != 0) {
__fortify_fatal("fcntl(F_SETFD) only supports FD_CLOEXEC but was passed %p", arg);
}
#ifdefined(__LP64__) int rc = __fcntl(fd, cmd, arg); #else // For LP32 we use the fcntl64 system call to signal that we're using struct flock64. int rc = __fcntl64(fd, cmd, arg); #endif if (cmd == F_DUPFD) { return FDTRACK_CREATE_NAME("F_DUPFD", rc);
} elseif (cmd == F_DUPFD_CLOEXEC) { return FDTRACK_CREATE_NAME("F_DUPFD_CLOEXEC", rc);
} return rc;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.