Page MenuHomeFreeBSD

runtime: add the ability to set exterrors in userspace
Needs ReviewPublic

Authored by brooks on Mon, Jul 6, 4:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 29, 8:25 AM
Unknown Object (File)
Wed, Jul 29, 8:21 AM
Unknown Object (File)
Wed, Jul 29, 8:19 AM
Unknown Object (File)
Wed, Jul 29, 4:46 AM
Unknown Object (File)
Wed, Jul 29, 1:42 AM
Unknown Object (File)
Tue, Jul 28, 10:06 AM
Unknown Object (File)
Tue, Jul 28, 7:05 AM
Unknown Object (File)
Tue, Jul 28, 12:14 AM
Subscribers

Details

Reviewers
kib
mckusick
Group Reviewers
cheri
Summary

The UEXTERROR(3) macro is a partial analog to EXTERROR(9) that sets
the current user exterror state and errno. The main difference is
that it returns no value and sets errno directly since that's the
typical pattern in libraries.

Effort: CHERI upstreaming
Sponsored by: Innovate UK

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 75161
Build 72044: arc lint + arc unit

Event Timeline

brooks requested review of this revision.Mon, Jul 6, 4:06 PM

The big thing that needs to be dealt with for this to make sense is to have a way to specify the filename that isn't a table embedded in libc. A first cut could be a special index that means no-file and perhaps using -1 as the line, but without that, we can't scale beyond files in the base system. (This also poses a problem for out of tree kernel modules.) We might also want macros like the kernel, but I'm less sure of that.

lib/libthr/thread/thr_syscalls.c
664

Create a libc helper in the private version namespace that takes uexterrp, and call it there and in the libc' uexterr_set().

Add helper in libc. Tag categories as user space.

This revision is now accepted and ready to land.Sat, Jul 18, 1:45 PM
lib/libc/gen/uexterr_gettext.c
39

Stylistically, I do not see a need in this blank line, and in the blank line at 60.

brooks retitled this revision from runtime: add uexterr_set(3) to set errors in userspace to runtime: add the ability to set exterrors in userspace.Wed, Jul 22, 1:53 PM

Add UEXTERROR() analog to EXTERROR(). It differs in that it just wraps uexterr_set and thus it gets a different name.

This revision now requires review to proceed.Wed, Jul 22, 1:58 PM

Add docs. Make uexterr_set return void.

include/uexterror.h
9

I believe you need to add your copyright there and in other sources.

lib/libc/gen/uexterr_gettext.c
28

I think these functions should go into separate source file in libc. There is no reason to bring uexterror_set() into the static binary if only gettext() is used.

brooks marked 3 inline comments as done.

Move to its own file, document, update copyrights

include/uexterror.h
9

Indeed, can we drop the All rights reserved.? The project doesn't want that in new copyrights.

kib added inline comments.
include/uexterror.h
9

Perhaps. Ask Ed, I used the header mandated by my contract.

lib/libc/gen/uexterr_gettext.c
13–14

To be perfect, this structure should go into a dedicated .c/.o as well.

This revision is now accepted and ready to land.Thu, Jul 23, 11:10 PM

Move global struct uexterror and constructor to its own file

This revision now requires review to proceed.Fri, Jul 24, 10:36 AM
brooks added a subscriber: emaste.
brooks added inline comments.
include/uexterror.h
9

Tagging @emaste

lib/libc/gen/uexterror.3
130

Definitely not 15.0

Correct feature introduction to 16.0. Bump doc date.