Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149661141
D5425.id13691.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5425.id13691.diff
View Options
Index: sys/kern/vfs_syscalls.c
===================================================================
--- sys/kern/vfs_syscalls.c
+++ sys/kern/vfs_syscalls.c
@@ -4457,6 +4457,18 @@
return (error);
}
+static int
+posix_filesys_error(struct thread *td, int error)
+{
+
+ if (error <= 0)
+ return (error);
+ td->td_errno = error;
+ td->td_pflags |= TDP_NERRNO;
+ td->td_retval[0] = error;
+ return (0);
+}
+
int
kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len)
{
@@ -4533,10 +4545,10 @@
int
sys_posix_fallocate(struct thread *td, struct posix_fallocate_args *uap)
{
+ int error;
- td->td_retval[0] = kern_posix_fallocate(td, uap->fd, uap->offset,
- uap->len);
- return (0);
+ error = kern_posix_fallocate(td, uap->fd, uap->offset, uap->len);
+ return (posix_filesys_error(td, error));
}
/*
@@ -4668,8 +4680,9 @@
int
sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap)
{
+ int error;
- td->td_retval[0] = kern_posix_fadvise(td, uap->fd, uap->offset,
- uap->len, uap->advice);
- return (0);
+ error = kern_posix_fadvise(td, uap->fd, uap->offset, uap->len,
+ uap->advice);
+ return (posix_filesys_error(td, error));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 27, 2:05 AM (3 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30404442
Default Alt Text
D5425.id13691.diff (1 KB)
Attached To
Mode
D5425: Improve error handling for posix file syscalls
Attached
Detach File
Event Timeline
Log In to Comment