This is an archive of the discontinued LLVM Phabricator instance.

Use fcntl.h to retrieve the O_CREAT and O_RDRW constants.
ClosedPublic

Authored by vkalintiris on Sep 21 2015, 6:56 AM.

Details

Summary

Normally, these macros are defined in fnctl.h. However, GLIBC exposes their
definition through <sys/file.h> too. This change allows us to compile LLDB
with non-GLIBC C libraries.

Diff Detail

Repository
rL LLVM

Event Timeline

vkalintiris retitled this revision from to Use fcntl.h to retrieve the O_CREAT and O_RDRW constants..
vkalintiris updated this object.
vkalintiris added a reviewer: clayborg.
vkalintiris added a subscriber: lldb-commits.
emaste accepted this revision.Sep 21 2015, 7:18 AM
emaste added a reviewer: emaste.
emaste added a subscriber: emaste.

LGTM

Although it ought to remain on the same line, no?

This revision is now accepted and ready to land.Sep 21 2015, 7:18 AM
vkalintiris updated this object.
vkalintiris edited edge metadata.

Use fcntl.h instead of sys/fcntl.h.

Although it ought to remain on the same line, no?

It shouldn't matter in this case. I just followed the order of the headers in the synopsis section of shm_open(3) on my system.
However, I noticed that we should use fcntl.h instead of sys/fcntl.h. The former is POSIX-compatible while the latter (based on my understanding) is being used to expose additional kernel-defines in some systems. Does this look good to you?

Yes, updated change LGTM.

clayborg accepted this revision.Sep 21 2015, 9:34 AM
clayborg edited edge metadata.

Looks good.

krytarowski accepted this revision.Sep 21 2015, 10:52 AM
krytarowski added a reviewer: krytarowski.
krytarowski added a subscriber: krytarowski.

You mean O_RDWR, not O_RDRW.

The patch is correct on NetBSD.

This revision was automatically updated to reflect the committed changes.