]>
git.saurik.com Git - apple/xnu.git/blob - bsd/sys/xattr.h
6628bbeee978f7b163fa3f9ae0adc8bf2d8bfa55
2 * Copyright (c) 2004-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 #include <sys/types.h>
28 /* Options for pathname based xattr calls */
29 #define XATTR_NOFOLLOW 0x0001 /* Don't follow symbolic links */
31 /* Options for setxattr calls */
32 #define XATTR_CREATE 0x0002 /* set the value, fail if attr already exists */
33 #define XATTR_REPLACE 0x0004 /* set the value, fail if attr does not exist */
35 /* Set this to bypass authorization checking (eg. if doing auth-related work) */
36 #define XATTR_NOSECURITY 0x0008
38 #define XATTR_MAXNAMELEN 127
40 #define XATTR_FINDERINFO_NAME "com.apple.FinderInfo"
42 #define XATTR_RESOURCEFORK_NAME "com.apple.ResourceFork"
47 int xattr_protected(const char *);
48 int xattr_validatename(const char *);
55 ssize_t
getxattr(const char *path
, const char *name
, void *value
, size_t size
, u_int32_t position
, int options
);
57 ssize_t
fgetxattr(int fd
, const char *name
, void *value
, size_t size
, u_int32_t position
, int options
);
59 int setxattr(const char *path
, const char *name
, const void *value
, size_t size
, u_int32_t position
, int options
);
61 int fsetxattr(int fd
, const char *name
, const void *value
, size_t size
, u_int32_t position
, int options
);
63 int removexattr(const char *path
, const char *name
, int options
);
65 int fremovexattr(int fd
, const char *name
, int options
);
67 ssize_t
listxattr(const char *path
, char *namebuff
, size_t size
, int options
);
69 ssize_t
flistxattr(int fd
, char *namebuff
, size_t size
, int options
);
74 #endif /* _SYS_XATTR_H_ */