Page MenuHomeFreeBSD

libsys: don't expose sigwait wrapper
ClosedPublic

Authored by brooks on Mar 5 2024, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 19, 5:56 AM
Unknown Object (File)
Thu, May 16, 10:04 AM
Unknown Object (File)
Sun, May 5, 8:09 PM
Unknown Object (File)
Sat, May 4, 1:20 PM
Unknown Object (File)
Mon, Apr 29, 2:26 AM
Unknown Object (File)
Sun, Apr 28, 5:23 PM
Unknown Object (File)
Sat, Apr 27, 9:21 PM
Unknown Object (File)
Fri, Apr 26, 4:19 PM
Subscribers

Details

Summary

Long ago (e129c18a83ef) sys_sigwait was wrapped to prevent sigwait()
from returning with EINTR. Through a series of changes this wrapper
become
libc_sigwait which was internal to libc and used solely in the
interposing table. To support a move of sigwait back to libc, move this
wrapper into interposing_table and rename it with an __libsys_ prefix.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks requested review of this revision.Mar 5 2024, 9:49 PM

There might be something to be said for putting libsys_sigwait in its own file. Alternatively we could also kill off sigwait and make it static instead.

Ok, but why moving the code into the interposer's file? I would see adding e.g. libc_sigwait.c source with the EINTR loop function. Or keeping the function in its current place.

Add a libsys_sigwait that implements __libsys_sigwait. I think we
might be able to move it back to libc and the libc interposer table,
but without further testing I'm worried about breaking things during
upgrades so I think this split makes sense for now.

lib/libsys/interposing_table.c
32

This addition is not needed.

35

Why not keep the prototype in libc_private.h?

lib/libsys/libsys_sigwait.c
30

Headers are already ordered alphabetically.

kib added inline comments.
lib/libc/include/libc_private.h
418

No need to use __restrict, libc is always compiled by mode where restrict is valid.

This revision is now accepted and ready to land.Mar 12 2024, 11:59 PM
This revision was automatically updated to reflect the committed changes.