summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2013-03-21 22:44:33 +0000
committerpjd <pjd@FreeBSD.org>2013-03-21 22:44:33 +0000
commit2a3cf7f364f936c42d03f20e3517e2213372b6bd (patch)
tree1c36abb6f394391f7fb768b78ab2d383820e11cb /sys
parentc966fdfb31aaad19afdaeaa7727b7f658662f433 (diff)
downloadFreeBSD-src-2a3cf7f364f936c42d03f20e3517e2213372b6bd.zip
FreeBSD-src-2a3cf7f364f936c42d03f20e3517e2213372b6bd.tar.gz
- Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of type
u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/freebsd32/syscalls.master7
-rw-r--r--sys/fs/tmpfs/tmpfs.h4
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c3
-rw-r--r--sys/kern/syscalls.master7
-rw-r--r--sys/kern/vfs_syscalls.c20
-rw-r--r--sys/sys/stat.h2
6 files changed, 23 insertions, 20 deletions
diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master
index 655296c..e7a18aa 100644
--- a/sys/compat/freebsd32/syscalls.master
+++ b/sys/compat/freebsd32/syscalls.master
@@ -114,8 +114,8 @@
32 AUE_GETSOCKNAME NOPROTO { int getsockname(int fdes, caddr_t asa, \
int *alen); }
33 AUE_ACCESS NOPROTO { int access(char *path, int amode); }
-34 AUE_CHFLAGS NOPROTO { int chflags(char *path, int flags); }
-35 AUE_FCHFLAGS NOPROTO { int fchflags(int fd, int flags); }
+34 AUE_CHFLAGS NOPROTO { int chflags(const char *path, u_long flags); }
+35 AUE_FCHFLAGS NOPROTO { int fchflags(int fd, u_long flags); }
36 AUE_SYNC NOPROTO { int sync(void); }
37 AUE_KILL NOPROTO { int kill(int pid, int signum); }
38 AUE_STAT COMPAT { int freebsd32_stat(char *path, \
@@ -693,7 +693,8 @@
389 AUE_NULL UNIMPL __mac_set_file
390 AUE_NULL NOPROTO { int kenv(int what, const char *name, \
char *value, int len); }
-391 AUE_LCHFLAGS NOPROTO { int lchflags(const char *path, int flags); }
+391 AUE_LCHFLAGS NOPROTO { int lchflags(const char *path, \
+ u_long flags); }
392 AUE_NULL NOPROTO { int uuidgen(struct uuid *store, \
int count); }
393 AUE_SENDFILE STD { int freebsd32_sendfile(int fd, int s, \
diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h
index 8073c64..8f03f10 100644
--- a/sys/fs/tmpfs/tmpfs.h
+++ b/sys/fs/tmpfs/tmpfs.h
@@ -183,7 +183,7 @@ struct tmpfs_node {
uid_t tn_uid;
gid_t tn_gid;
mode_t tn_mode;
- int tn_flags;
+ u_long tn_flags;
nlink_t tn_links;
struct timespec tn_atime;
struct timespec tn_mtime;
@@ -418,7 +418,7 @@ int tmpfs_dir_getdents(struct tmpfs_node *, struct uio *, int,
int tmpfs_dir_whiteout_add(struct vnode *, struct componentname *);
void tmpfs_dir_whiteout_remove(struct vnode *, struct componentname *);
int tmpfs_reg_resize(struct vnode *, off_t, boolean_t);
-int tmpfs_chflags(struct vnode *, int, struct ucred *, struct thread *);
+int tmpfs_chflags(struct vnode *, u_long, struct ucred *, struct thread *);
int tmpfs_chmod(struct vnode *, mode_t, struct ucred *, struct thread *);
int tmpfs_chown(struct vnode *, uid_t, gid_t, struct ucred *,
struct thread *);
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index b003b2c..4739f85 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -1355,7 +1355,8 @@ retry:
* The vnode must be locked on entry and remain locked on exit.
*/
int
-tmpfs_chflags(struct vnode *vp, int flags, struct ucred *cred, struct thread *p)
+tmpfs_chflags(struct vnode *vp, u_long flags, struct ucred *cred,
+ struct thread *p)
{
int error;
struct tmpfs_node *node;
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 9c22f2b..7b45c80 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -115,8 +115,8 @@
struct sockaddr * __restrict asa, \
__socklen_t * __restrict alen); }
33 AUE_ACCESS STD { int access(char *path, int amode); }
-34 AUE_CHFLAGS STD { int chflags(char *path, int flags); }
-35 AUE_FCHFLAGS STD { int fchflags(int fd, int flags); }
+34 AUE_CHFLAGS STD { int chflags(const char *path, u_long flags); }
+35 AUE_FCHFLAGS STD { int fchflags(int fd, u_long flags); }
36 AUE_SYNC STD { int sync(void); }
37 AUE_KILL STD { int kill(int pid, int signum); }
38 AUE_STAT COMPAT { int stat(char *path, struct ostat *ub); }
@@ -696,7 +696,8 @@
struct mac *mac_p); }
390 AUE_NULL STD { int kenv(int what, const char *name, \
char *value, int len); }
-391 AUE_LCHFLAGS STD { int lchflags(const char *path, int flags); }
+391 AUE_LCHFLAGS STD { int lchflags(const char *path, \
+ u_long flags); }
392 AUE_NULL STD { int uuidgen(struct uuid *store, \
int count); }
393 AUE_SENDFILE STD { int sendfile(int fd, int s, off_t offset, \
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 1c361bd..6195321 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -101,7 +101,7 @@ SDT_PROBE_ARGTYPE(vfs, , stat, reg, 1, "int");
static int chroot_refuse_vdir_fds(struct filedesc *fdp);
static int getutimes(const struct timeval *, enum uio_seg, struct timespec *);
-static int setfflags(struct thread *td, struct vnode *, int);
+static int setfflags(struct thread *td, struct vnode *, u_long);
static int setutimes(struct thread *td, struct vnode *,
const struct timespec *, int, int);
static int vn_access(struct vnode *vp, int user_flags, struct ucred *cred,
@@ -2615,7 +2615,7 @@ static int
setfflags(td, vp, flags)
struct thread *td;
struct vnode *vp;
- int flags;
+ u_long flags;
{
int error;
struct mount *mp;
@@ -2657,16 +2657,16 @@ setfflags(td, vp, flags)
*/
#ifndef _SYS_SYSPROTO_H_
struct chflags_args {
- char *path;
- int flags;
+ const char *path;
+ u_long flags;
};
#endif
int
sys_chflags(td, uap)
struct thread *td;
register struct chflags_args /* {
- char *path;
- int flags;
+ const char *path;
+ u_long flags;
} */ *uap;
{
int error;
@@ -2689,8 +2689,8 @@ int
sys_lchflags(td, uap)
struct thread *td;
register struct lchflags_args /* {
- char *path;
- int flags;
+ const char *path;
+ u_long flags;
} */ *uap;
{
int error;
@@ -2713,7 +2713,7 @@ sys_lchflags(td, uap)
#ifndef _SYS_SYSPROTO_H_
struct fchflags_args {
int fd;
- int flags;
+ u_long flags;
};
#endif
int
@@ -2721,7 +2721,7 @@ sys_fchflags(td, uap)
struct thread *td;
register struct fchflags_args /* {
int fd;
- int flags;
+ u_long flags;
} */ *uap;
{
struct file *fp;
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index ba4f4d4..ec6efae 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -306,7 +306,7 @@ int fchmodat(int, const char *, mode_t, int);
#endif
int fstat(int, struct stat *);
#if __BSD_VISIBLE
-int lchflags(const char *, int);
+int lchflags(const char *, unsigned long);
int lchmod(const char *, mode_t);
#endif
#if __POSIX_VISIBLE >= 200112
OpenPOWER on IntegriCloud