mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
pidfds: Return EINVAL for fasync
Matches latest Linux behavior. The native pidfd test has also been deflaked. PiperOrigin-RevId: 911141375
This commit is contained in:
committed by
gVisor bot
parent
410668dd43
commit
d5ef80320d
@@ -88,7 +88,7 @@ func (f *pidFD) Epollable() bool {
|
||||
|
||||
// RegisterFileAsyncHandler implements vfs.FileDescriptionImpl.RegisterFileAsyncHandler.
|
||||
func (f *pidFD) RegisterFileAsyncHandler(fd *vfs.FileDescription) error {
|
||||
return linuxerr.ENOTTY
|
||||
return linuxerr.EINVAL
|
||||
}
|
||||
|
||||
// UnregisterFileAsyncHandler implements vfs.FileDescriptionImpl.UnregisterFileAsyncHandler.
|
||||
|
||||
@@ -1200,8 +1200,16 @@ TEST(PidfdTest, FasyncIsUnsupported) {
|
||||
ASSERT_THAT(fcntl(pidfd.get(), F_SETFL, flags | FASYNC), SyscallSucceeds());
|
||||
int who = getpid();
|
||||
|
||||
int want_errno = EINVAL;
|
||||
if (!IsRunningOnGvisor()) {
|
||||
KernelVersion version = ASSERT_NO_ERRNO_AND_VALUE(GetKernelVersion());
|
||||
if (version.major < 6 || (version.major == 6 && version.minor < 9)) {
|
||||
want_errno = ENOTTY;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_THAT(ioctl(pidfd.get(), FIOSETOWN, &who),
|
||||
SyscallFailsWithErrno(ENOTTY));
|
||||
SyscallFailsWithErrno(want_errno));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user