Mon Jul 18 11:28:24 2011 UTC ()
make the data arguments of *setxattr(2) const, as in Linux
(is this an official NetBSD API or should it be COMPAT_LINUX only?)


(drochner)
diff -r1.249 -r1.250 src/sys/kern/syscalls.master
diff -r1.3 -r1.4 src/sys/sys/xattr.h

cvs diff -r1.249 -r1.250 src/sys/kern/syscalls.master (expand / switch to unified diff)

--- src/sys/kern/syscalls.master 2011/06/26 17:05:24 1.249
+++ src/sys/kern/syscalls.master 2011/07/18 11:28:24 1.250
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.249 2011/06/26 17:05:24 christos Exp $ 1 $NetBSD: syscalls.master,v 1.250 2011/07/18 11:28:24 drochner Exp $
2 2
3; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 3; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
4 4
5; NetBSD system call name/number "master" file. 5; NetBSD system call name/number "master" file.
6; (See syscalls.conf to see what it is processed into.) 6; (See syscalls.conf to see what it is processed into.)
7; 7;
8; Fields: number type [type-dependent ...] 8; Fields: number type [type-dependent ...]
9; number system call number, must be in order 9; number system call number, must be in order
10; type one of STD, OBSOL, UNIMPL, IGNORED, NODEF, NOARGS, or one of 10; type one of STD, OBSOL, UNIMPL, IGNORED, NODEF, NOARGS, or one of
11; the compatibility options defined in syscalls.conf. 11; the compatibility options defined in syscalls.conf.
12; 12;
13; Optional fields are specified after the type field 13; Optional fields are specified after the type field
14; (NOTE! they *must* be specified in this order): 14; (NOTE! they *must* be specified in this order):
@@ -708,33 +708,33 @@ @@ -708,33 +708,33 @@
708 int attrnamespace, const char *attrname); } 708 int attrnamespace, const char *attrname); }
709370 STD RUMP { ssize_t|sys||extattr_list_fd(int fd, \ 709370 STD RUMP { ssize_t|sys||extattr_list_fd(int fd, \
710 int attrnamespace, void *data, size_t nbytes); } 710 int attrnamespace, void *data, size_t nbytes); }
711371 STD RUMP { ssize_t|sys||extattr_list_file(const char *path, \ 711371 STD RUMP { ssize_t|sys||extattr_list_file(const char *path, \
712 int attrnamespace, void *data, size_t nbytes); } 712 int attrnamespace, void *data, size_t nbytes); }
713372 STD RUMP { ssize_t|sys||extattr_list_link(const char *path, \ 713372 STD RUMP { ssize_t|sys||extattr_list_link(const char *path, \
714 int attrnamespace, void *data, size_t nbytes); } 714 int attrnamespace, void *data, size_t nbytes); }
715373 COMPAT_50 MODULAR RUMP { int|sys||pselect(int nd, fd_set *in, fd_set *ou, \ 715373 COMPAT_50 MODULAR RUMP { int|sys||pselect(int nd, fd_set *in, fd_set *ou, \
716 fd_set *ex, const struct timespec50 *ts, \ 716 fd_set *ex, const struct timespec50 *ts, \
717 const sigset_t *mask); } 717 const sigset_t *mask); }
718374 COMPAT_50 MODULAR RUMP { int|sys||pollts(struct pollfd *fds, u_int nfds, \ 718374 COMPAT_50 MODULAR RUMP { int|sys||pollts(struct pollfd *fds, u_int nfds, \
719 const struct timespec50 *ts, const sigset_t *mask); } 719 const struct timespec50 *ts, const sigset_t *mask); }
720375 STD RUMP { int|sys||setxattr(const char *path, \ 720375 STD RUMP { int|sys||setxattr(const char *path, \
721 const char *name, void *value, size_t size, \ 721 const char *name, const void *value, size_t size, \
722 int flags); } 722 int flags); }
723376 STD RUMP { int|sys||lsetxattr(const char *path, \ 723376 STD RUMP { int|sys||lsetxattr(const char *path, \
724 const char *name, void *value, size_t size, \ 724 const char *name, const void *value, size_t size, \
725 int flags); } 725 int flags); }
726377 STD RUMP { int|sys||fsetxattr(int fd, \ 726377 STD RUMP { int|sys||fsetxattr(int fd, \
727 const char *name, void *value, size_t size, \ 727 const char *name, const void *value, size_t size, \
728 int flags); } 728 int flags); }
729378 STD RUMP { int|sys||getxattr(const char *path, \ 729378 STD RUMP { int|sys||getxattr(const char *path, \
730 const char *name, void *value, size_t size); } 730 const char *name, void *value, size_t size); }
731379 STD RUMP { int|sys||lgetxattr(const char *path, \ 731379 STD RUMP { int|sys||lgetxattr(const char *path, \
732 const char *name, void *value, size_t size); } 732 const char *name, void *value, size_t size); }
733380 STD RUMP { int|sys||fgetxattr(int fd, \ 733380 STD RUMP { int|sys||fgetxattr(int fd, \
734 const char *name, void *value, size_t size); } 734 const char *name, void *value, size_t size); }
735381 STD RUMP { int|sys||listxattr(const char *path, \ 735381 STD RUMP { int|sys||listxattr(const char *path, \
736 char *list, size_t size); } 736 char *list, size_t size); }
737382 STD RUMP { int|sys||llistxattr(const char *path, \ 737382 STD RUMP { int|sys||llistxattr(const char *path, \
738 char *list, size_t size); } 738 char *list, size_t size); }
739383 STD RUMP { int|sys||flistxattr(int fd, \ 739383 STD RUMP { int|sys||flistxattr(int fd, \
740 char *list, size_t size); } 740 char *list, size_t size); }

cvs diff -r1.3 -r1.4 src/sys/sys/xattr.h (expand / switch to unified diff)

--- src/sys/sys/xattr.h 2008/04/28 20:24:11 1.3
+++ src/sys/sys/xattr.h 2011/07/18 11:28:24 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xattr.h,v 1.3 2008/04/28 20:24:11 martin Exp $ */ 1/* $NetBSD: xattr.h,v 1.4 2011/07/18 11:28:24 drochner Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2005 The NetBSD Foundation, Inc. 4 * Copyright (c) 2005 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -49,29 +49,29 @@ @@ -49,29 +49,29 @@
49 */ 49 */
50#define XATTR_NAME_MAX NAME_MAX 50#define XATTR_NAME_MAX NAME_MAX
51 51
52#define XATTR_SIZE_MAX 65536 /* NetBSD does not enforce this */ 52#define XATTR_SIZE_MAX 65536 /* NetBSD does not enforce this */
53 53
54#define XATTR_CREATE 0x01 /* create, don't replace xattr */ 54#define XATTR_CREATE 0x01 /* create, don't replace xattr */
55#define XATTR_REPLACE 0x02 /* replace, don't create xattr */ 55#define XATTR_REPLACE 0x02 /* replace, don't create xattr */
56 56
57#ifndef _KERNEL 57#ifndef _KERNEL
58 58
59#include <sys/cdefs.h> 59#include <sys/cdefs.h>
60 60
61__BEGIN_DECLS 61__BEGIN_DECLS
62int setxattr(const char *, const char *, void *, size_t, int); 62int setxattr(const char *, const char *, const void *, size_t, int);
63int lsetxattr(const char *, const char *, void *, size_t, int); 63int lsetxattr(const char *, const char *, const void *, size_t, int);
64int fsetxattr(int, const char *, void *, size_t, int); 64int fsetxattr(int, const char *, const void *, size_t, int);
65 65
66ssize_t getxattr(const char *, const char *, void *, size_t); 66ssize_t getxattr(const char *, const char *, void *, size_t);
67ssize_t lgetxattr(const char *, const char *, void *, size_t); 67ssize_t lgetxattr(const char *, const char *, void *, size_t);
68ssize_t fgetxattr(int, const char *, void *, size_t); 68ssize_t fgetxattr(int, const char *, void *, size_t);
69 69
70ssize_t listxattr(const char *, char *, size_t); 70ssize_t listxattr(const char *, char *, size_t);
71ssize_t llistxattr(const char *, char *, size_t); 71ssize_t llistxattr(const char *, char *, size_t);
72ssize_t flistxattr(int, char *, size_t); 72ssize_t flistxattr(int, char *, size_t);
73 73
74int removexattr(const char *, const char *); 74int removexattr(const char *, const char *);
75int lremovexattr(const char *, const char *); 75int lremovexattr(const char *, const char *);
76int fremovexattr(int, const char *); 76int fremovexattr(int, const char *);
77__END_DECLS 77__END_DECLS