NAME
ug_display_width() — get current display width for user and group names
SYNOPSIS
#include <stdlib.h>
int ug_display_width(void);
DESCRIPTION
The
ug_display_width()
function returns the current display width for user and group names.
This value determines how many bytes of a user or group name
that system and conforming applications will display.
On a system with long user and group names enabled,
the default display width for the system is set with the
lugadmin
command (see
lugadmin(1M)).
Users can override the default value
by setting the environment variable
UG_DISPLAY_WIDTH
to an integer value in the range
0
to
255.
Application Usage
System and conforming applications use the return value (current display width)
for formatted output as follows:
- -1
Long user and group names are not configured on the system.
Display user and group names as per default settings.
- 0 to 8
Long user and group name are enabled but display user and group names
as per default settings.
For user and group names longer (in bytes) than the default
allowable length, truncate the name to the maximum default length
and replace the last printed character with a plus sign
(+).
- 9 to 255
If the name is longer (in bytes) than the current display width,
truncate the name to this length (in bytes) and replace the last
printed character with a plus sign
(+).
EXTERNAL INFLUENCES
Environment Variables
- UG_DISPLAY_WIDTH
If it is set and long user and group names are enabled,
it overrides the width that is specified by the
lugadmin
command for all system and conforming applications that write formatted output.
RETURN VALUE
ug_display_width()
returns one of the following values:
- -1
Long user and group names are not enabled, or an internal error occurred.
- 0
Long user and group names are enabled but set to default value.
- 9 to 255
The current display width for long user and group names.
WARNINGS
It is recommended that you do not modify the
/etc/defaults/lugname
file directly.
Doing so could cause incorrect behavior.
FILES
- /etc/defaults/lugname
If this file is present,
the system is enabled for long user and group names;
otherwise, it is not.
This file contains the default display width,
as set with the
lugadmin
command.