GETSTSRC(3)

NAME
getstsrc, setstsrc - read and write a stream identifier

SYNOPSIS
char *getstsrc(fd)
setstsrc(fd, name)
char *name;

DESCRIPTION
Setstsrc attaches a descriptive string to the indicated stream, and getstsrc returns a pointer to a static buffer containing the string. The string persists until final close of the stream. When a stream is first opened the string is trivial.

Setstsrc requires capability T_EXTERN; see getplab(2). The string conventionally names the off-machine source of the stream. Since only trusted processes may modify it, it may be relied on for security calculations.

Getstsrc returns 0 on error, setstsrc returns -1 on error.

SEE ALSO
stream(4)

DIAGNOSTICS
EPERM, ENOTTY

BUGS
The return value of getstsrc points to static data whose content is overwritten by each call.