Skip to content

Commit

Permalink
Include <fcntl.h> instead of <sys/fcntl.h>
Browse files Browse the repository at this point in the history
Fixes the following warnings when building on systems using the musl libc:
```
In file included from sysfs.c:4:
/usr/riscv64-unknown-linux-musl/include/sys/fcntl.h:1:2: warning: redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-W#warnings]
    1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
      |  ^
1 warning generated.
```

On systems using glibc this is also just a wrapper:

> $ cat /usr/include/sys/fcntl.h
> #include <fcntl.h>

Signed-off-by: Marvin Schmidt <marv@exherbo.org>
  • Loading branch information
marv authored and andikleen committed Jan 6, 2024
1 parent 3a85c29 commit 4dfbd3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion memhog.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
on your Linux system; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/fcntl.h>
#include <string.h>
#include <stdbool.h>
#include "numa.h"
Expand Down
2 changes: 1 addition & 1 deletion sysfs.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Utility functions for reading sysfs values */
#define _GNU_SOURCE 1
#include <fcntl.h>
#include <stdio.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
Expand Down

0 comments on commit 4dfbd3f

Please sign in to comment.