Page MenuHomeFreeBSD

Implement ppoll() function.
ClosedPublic

Authored by dchagin on Nov 9 2014, 8:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 4:52 AM
Unknown Object (File)
Fri, Dec 6, 10:24 PM
Unknown Object (File)
Fri, Nov 29, 10:10 PM
Unknown Object (File)
Oct 27 2024, 2:37 AM
Unknown Object (File)
Oct 15 2024, 12:18 PM
Unknown Object (File)
Oct 10 2024, 2:45 PM
Unknown Object (File)
Oct 1 2024, 1:48 PM
Unknown Object (File)
Sep 30 2024, 11:23 PM
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
Lint Skipped
Unit
Tests Skipped

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
1410 ↗(On Diff #2336)

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 ↗(On Diff #2336)

This namespace pollution must be under #Ifdef __BSD_VISIBLE.

112 ↗(On Diff #2336)

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 ↗(On Diff #2365)

Line too long, wrap it.

156 ↗(On Diff #2365)

.Fa fds
and
.Fa nfds

164 ↗(On Diff #2365)

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

232 ↗(On Diff #2365)

New sentence -> new line.

sys/sys/poll.h
107 ↗(On Diff #2365)

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 ↗(On Diff #2365)

"unlike" is an aside, said with pauses:

system call, unlike
.Fn poll ,

154 ↗(On Diff #2365)

"allows" implies that it is optional.

"is used to safely wait until..."

164 ↗(On Diff #2365)

Right:

.Vt "const struct timespec"
which is defined in

169 ↗(On Diff #2365)

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 ↗(On Diff #2365)

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).