Page MenuHomeFreeBSD

Implement ppoll() function.
ClosedPublic

Authored by dchagin on Nov 9 2014, 8:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 17 2024, 9:15 AM
Unknown Object (File)
Mar 17 2024, 8:53 AM
Unknown Object (File)
Jan 24 2024, 1:14 PM
Unknown Object (File)
Jan 4 2024, 1:40 PM
Unknown Object (File)
Dec 19 2023, 10:59 PM
Unknown Object (File)
Dec 14 2023, 11:00 AM
Unknown Object (File)
Dec 9 2023, 1:33 AM
Unknown Object (File)
Dec 4 2023, 7:20 AM
Subscribers

Details

Reviewers
kib
trasz
Group Reviewers
manpages
Commits
rS274462: Add the ppoll() system call.
Summary

Implement ppoll() function.
Add kern_ppoll() version needed by an upcoming Linuxulator change.

Perhaps need to specify that it is non-standard function, i.e., Linux specific?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

dchagin retitled this revision from to Implement ppoll() function..
dchagin updated this object.
lib/libc/include/namespace.h
85 ↗(On Diff #2336)

I do not see why is this needed. There is no ppoll(2) callers in libc.

lib/libc/sys/ppoll.2
1 ↗(On Diff #2336)

IMO, it would be more useful to change the poll(2) man page. The changes would consist of adding the function prototype, a paragraph with description, and symlink.

The existing separate man pages for select(2) and pselect(2) are due to the history of pselect. It was initially implemented as library function with bug, and later reimplemented in kernel. In fact, it makes sense to merge select(2) and pselect(2) as well.

sys/kern/sys_generic.c
1435

Would it reduce code size by merging kern_poll and kern_ppoll() ? Make kern_poll() take struct timespec * and sigset_t *.

sys/sys/poll.h
35

This namespace pollution must be under #Ifdef __BSD_VISIBLE.

115

And this one too (__BSD_VISIBLE).

Fixed.

in passing sys_poll() converted to c99, if this change is not needed, i'll remove it

Overall, this looks good.

lib/libc/sys/poll.2
154

Line too long, wrap it.

156

.Fa fds
and
.Fa nfds

164

split the line, 'which is defined' is intrpreted as .Vt

232

New sentence -> new line.

sys/sys/poll.h
107

How does glibc handle this ? My gut feeling is that including sys/sigset.h and sys/timespec.h is the duty of the user code. Then, poll.h only needs to forward-declare struct timespec and struct __sigset.

But we arguably should keep this compatible with Linux.

wblock added inline comments.
lib/libc/sys/poll.2
152

"unlike" is an aside, said with pauses:

system call, unlike
.Fn poll ,

154

"allows" implies that it is optional.

"is used to safely wait until..."

164

Right:

.Vt "const struct timespec"
which is defined in

169

Rather than a semicolon, just break the sentence there:

.Fn poll .
A null pointer...

dchagin edited edge metadata.

Fixed notes to the ppoll(2) manpage.

sys/sys/poll.h
107

glibc does it for the user, it can be seen in io/sys/poll.h glibc header.
also according to the man poll user code should include only poll.h.

kib edited edge metadata.

The web interface shows some garbage for me.

When I download the raw diff, poll.2 chunks are duplicated. I have no idea is this yet another bug of the web review thing, or there is some problem with the patch.

Anyway, I do not have more comments.

This revision is now accepted and ready to land.Nov 12 2014, 8:34 PM
trasz edited edge metadata.
dchagin updated this revision to Diff 2383.

Closed by commit rS274462 (authored by @dchagin).