Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F4128743
test_xattr.c
fsu (Fedor Uporov)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
fsu
Jan 10 2019, 5:22 PM
2019-01-10 17:22:48 (UTC+0)
Size
983 B
Referenced Files
None
Subscribers
None
test_xattr.c
View Options
#include
<stdlib.h>
#include
<stdio.h>
#include
<unistd.h>
#include
<fcntl.h>
#include
<errno.h>
#include
<sys/types.h>
#include
<sys/xattr.h>
void
test_assert
(
int
x
,
int
line
)
{
if
(
!
x
)
{
printf
(
"test_assert => FAILED. Line:%d, errno = %d
\n
"
,
line
,
errno
);
exit
(
1
);
}
}
/*
* Before the fix:
* root@:~ # ./exec
* test_assert => FAILED. Line:28, errno = 61
*
* After the fix:
* root@:~ # ./exec
*/
int
main
()
{
const
char
*
path
=
"//tmp/test.file"
;
int
fd
=
open
(
path
,
O_RDONLY
|
O_CREAT
);
if
(
fd
<
0
)
{
printf
(
"Cannot create file => %d
\n
"
,
errno
);
exit
(
1
);
}
close
(
fd
);
ssize_t
ret
=
listxattr
(
path
,
NULL
,
0
);
test_assert
(
errno
==
ENOTSUP
,
__LINE__
);
ret
=
getxattr
(
path
,
"user.key"
,
NULL
,
0
);
test_assert
(
errno
==
ENOTSUP
,
__LINE__
);
ret
=
setxattr
(
path
,
"user.key"
,
"value"
,
sizeof
(
"value"
),
XATTR_CREATE
);
test_assert
(
errno
==
ENOTSUP
,
__LINE__
);
ret
=
removexattr
(
path
,
"user.key"
);
test_assert
(
errno
==
ENOTSUP
,
__LINE__
);
return
0
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1709314
Default Alt Text
test_xattr.c (983 B)
Attached To
Mode
D18812: Fix errno values returned from DUMMY_XATTR linuxulator calls.
Attached
Detach File
Event Timeline
Log In to Comment