Skip to content

Commit

Permalink
Add FreeBSD required defines to mntent.h
Browse files Browse the repository at this point in the history
Linux and FreeBSD use different names for suid / setuid.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes openzfs#9632
  • Loading branch information
mattmacy authored and behlendorf committed Nov 30, 2019
1 parent 758699b commit 42a826e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/sys/mntent.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#ifndef _SYS_MNTENT_H
#define _SYS_MNTENT_H

#define MNTMAXSTR 128

#define MNTTYPE_ZFS "zfs" /* ZFS file system */

#define MOUNT_SUCCESS 0x00 /* Success */
Expand Down Expand Up @@ -71,8 +73,15 @@
#define MNTOPT_STRICTATIME "strictatime" /* strict access time updates */
#define MNTOPT_NOSTRICTATIME "nostrictatime" /* No strict access time updates */
#define MNTOPT_LAZYTIME "lazytime" /* Defer access time writing */
#ifdef __linux__
#define MNTOPT_SETUID "suid" /* Both setuid and devices allowed */
#define MNTOPT_NOSETUID "nosuid" /* Neither setuid nor devices allowed */
#elif defined(__FreeBSD__)
#define MNTOPT_SETUID "setuid" /* Set uid allowed */
#define MNTOPT_NOSETUID "nosetuid" /* Set uid not allowed */
#else
#error "unknown OS"
#endif
#define MNTOPT_OWNER "owner" /* allow owner mount */
#define MNTOPT_NOOWNER "noowner" /* do not allow owner mount */
#define MNTOPT_REMOUNT "remount" /* change mount options */
Expand Down

0 comments on commit 42a826e

Please sign in to comment.