JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 3: Extended Library Functions     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

Preface

Extended Library Functions - Part 1

Extended Library Functions - Part 2

Extended Library Functions - Part 3

gelf_update_getmove(3ELF)

gelf_update_move(3ELF)

gelf_update_phdr(3ELF)

gelf_update_rel(3ELF)

gelf_update_rela(3ELF)

gelf_update_shdr(3ELF)

gelf_update_sym(3ELF)

gelf_update_syminfo(3ELF)

gelf_update_symshndx(3ELF)

gelf_xlatetof(3ELF)

gelf_xlatetom(3ELF)

getacdir(3BSM)

getacflg(3BSM)

getacinfo(3BSM)

getacmin(3BSM)

getacna(3BSM)

getauclassent(3BSM)

getauclassent_r(3BSM)

getauclassnam(3BSM)

getauclassnam_r(3BSM)

getauditflags(3BSM)

getauditflagsbin(3BSM)

getauditflagschar(3BSM)

getauevent(3BSM)

getauevent_r(3BSM)

getauevnam(3BSM)

getauevnam_r(3BSM)

getauevnonam(3BSM)

getauevnum(3BSM)

getauevnum_r(3BSM)

getauthattr(3SECDB)

getauthnam(3SECDB)

getauuserent(3BSM)

getauuserent_r(3BSM)

getauusernam(3BSM)

getauusernam_r(3BSM)

getdefaultproj(3PROJECT)

getexecattr(3SECDB)

getexecprof(3SECDB)

getexecuser(3SECDB)

getfauditflags(3BSM)

getpathbylabel(3TSOL)

getplabel(3TSOL)

getprofattr(3SECDB)

getproflist(3SECDB)

getprofnam(3SECDB)

getprojbyid(3PROJECT)

getprojbyname(3PROJECT)

getprojent(3PROJECT)

getprojidbyname(3PROJECT)

getuserattr(3SECDB)

getusernam(3SECDB)

getuserrange(3TSOL)

getuseruid(3SECDB)

getzoneidbylabel(3TSOL)

getzonelabelbyid(3TSOL)

getzonelabelbyname(3TSOL)

getzonerootbyid(3TSOL)

getzonerootbylabel(3TSOL)

getzonerootbyname(3TSOL)

gl_abandon_line(3TECLA)

gl_append_history(3TECLA)

gl_automatic_history(3TECLA)

gl_bind_keyseq(3TECLA)

gl_catch_blocked(3TECLA)

gl_change_terminal(3TECLA)

gl_clear_history(3TECLA)

gl_completion_action(3TECLA)

gl_configure_getline(3TECLA)

gl_customize_completion(3TECLA)

gl_display_text(3TECLA)

gl_echo_mode(3TECLA)

gl_erase_terminal(3TECLA)

gl_error_message(3TECLA)

gl_get_line(3TECLA)

gl_group_history(3TECLA)

gl_handle_signal(3TECLA)

gl_ignore_signal(3TECLA)

gl_inactivity_timeout(3TECLA)

gl_io_mode(3TECLA)

gl_last_signal(3TECLA)

gl_limit_history(3TECLA)

gl_list_signals(3TECLA)

gl_load_history(3TECLA)

gl_lookup_history(3TECLA)

gl_normal_io(3TECLA)

gl_pending_io(3TECLA)

gl_prompt_style(3TECLA)

gl_query_char(3TECLA)

gl_range_of_history(3TECLA)

gl_raw_io(3TECLA)

gl_read_char(3TECLA)

gl_register_action(3TECLA)

gl_replace_prompt(3TECLA)

gl_resize_history(3TECLA)

gl_return_status(3TECLA)

gl_save_history(3TECLA)

gl_set_term_size(3TECLA)

gl_show_history(3TECLA)

gl_size_of_history(3TECLA)

gl_state_of_history(3TECLA)

gl_terminal_size(3TECLA)

gl_toggle_history(3TECLA)

gl_trap_signal(3TECLA)

gl_tty_signals(3TECLA)

gl_watch_fd(3TECLA)

gmatch(3GEN)

h_alloc(3TSOL)

HBA_CloseAdapter(3HBAAPI)

HBA_FreeLibrary(3HBAAPI)

HBA_GetAdapterAttributes(3HBAAPI)

HBA_GetAdapterName(3HBAAPI)

HBA_GetAdapterPortAttributes(3HBAAPI)

HBA_GetBindingCapability(3HBAAPI)

HBA_GetBindingSupport(3HBAAPI)

HBA_GetDiscoveredPortAttributes(3HBAAPI)

HBA_GetEventBuffer(3HBAAPI)

HBA_GetFC4Statistics(3HBAAPI)

HBA_GetFcpPersistentBinding(3HBAAPI)

HBA_GetFCPStatistics(3HBAAPI)

HBA_GetFcpTargetMapping(3HBAAPI)

HBA_GetFcpTargetMappingV2(3HBAAPI)

HBA_GetNumberOfAdapters(3HBAAPI)

HBA_GetPersistentBindingV2(3HBAAPI)

HBA_GetPortAttributesByWWN(3HBAAPI)

HBA_GetPortStatistics(3HBAAPI)

HBA_GetRNIDMgmtInfo(3HBAAPI)

HBA_GetVendorLibraryAttributes(3HBAAPI)

HBA_GetVersion(3HBAAPI)

HBA_GetWrapperLibraryAttributes(3HBAAPI)

HBA_LoadLibrary(3HBAAPI)

HBA_OpenAdapter(3HBAAPI)

HBA_OpenAdapterByWWN(3HBAAPI)

HBA_RefreshAdapterConfiguration(3HBAAPI)

HBA_RefreshInformation(3HBAAPI)

HBA_RegisterForAdapterAddEvents(3HBAAPI)

HBA_RegisterForAdapterEvents(3HBAAPI)

HBA_RegisterForAdapterPortEvents(3HBAAPI)

HBA_RegisterForAdapterPortStatEvents(3HBAAPI)

HBA_RegisterForLinkEvents(3HBAAPI)

HBA_RegisterForTargetEvents(3HBAAPI)

HBA_RemoveAllPersistentBindings(3HBAAPI)

HBA_RemoveCallback(3HBAAPI)

HBA_RemovePersistentBinding(3HBAAPI)

HBA_ResetStatistics(3HBAAPI)

HBA_ScsiInquiryV2(3HBAAPI)

HBA_ScsiReadCapacityV2(3HBAAPI)

HBA_ScsiReportLUNsV2(3HBAAPI)

HBA_SendCTPassThru(3HBAAPI)

HBA_SendCTPassThruV2(3HBAAPI)

HBA_SendLIRR(3HBAAPI)

HBA_SendReadCapacity(3HBAAPI)

HBA_SendReportLUNs(3HBAAPI)

HBA_SendRLS(3HBAAPI)

HBA_SendRNID(3HBAAPI)

HBA_SendRNIDV2(3HBAAPI)

HBA_SendRPL(3HBAAPI)

HBA_SendRPS(3HBAAPI)

HBA_SendScsiInquiry(3HBAAPI)

HBA_SendSRL(3HBAAPI)

HBA_SetBindingSupport(3HBAAPI)

HBA_SetPersistentBindingV2(3HBAAPI)

HBA_SetRNIDMgmtInfo(3HBAAPI)

hextob(3TSOL)

h_free(3TSOL)

htobclear(3TSOL)

htobsl(3TSOL)

hypot(3M)

hypotf(3M)

hypotl(3M)

idn_decodename2(3EXT)

idn_decodename(3EXT)

idn_enable(3EXT)

idn_encodename(3EXT)

idn_nameinit(3EXT)

IFDHCloseChannel(3SMARTCARD)

IFDHControl(3SMARTCARD)

IFDHCreateChannel(3SMARTCARD)

IFDHCreateChannelByName(3SMARTCARD)

IFDHGetCapabilities(3SMARTCARD)

IFDHICCPresence(3SMARTCARD)

IFDHPowerICC(3SMARTCARD)

IFDHSetCapabilities(3SMARTCARD)

IFDHSetProtocolParameters(3SMARTCARD)

IFDHTransmitToICC(3SMARTCARD)

ilogb(3M)

ilogbf(3M)

ilogbl(3M)

inproj(3PROJECT)

isencrypt(3GEN)

isfinite(3M)

isgreater(3M)

isgreaterequal(3M)

isinf(3M)

isless(3M)

islessequal(3M)

islessgreater(3M)

isnan(3M)

isnormal(3M)

isunordered(3M)

j0(3M)

j0f(3M)

j0l(3M)

j1(3M)

j1f(3M)

j1l(3M)

jn(3M)

jnf(3M)

jnl(3M)

kstat(3KSTAT)

Kstat(3PERL)

kstat_chain_update(3KSTAT)

kstat_close(3KSTAT)

kstat_data_lookup(3KSTAT)

kstat_lookup(3KSTAT)

kstat_open(3KSTAT)

kstat_read(3KSTAT)

kstat_write(3KSTAT)

kva_match(3SECDB)

kvm_close(3KVM)

kvm_getcmd(3KVM)

kvm_getproc(3KVM)

kvm_getu(3KVM)

kvm_kread(3KVM)

kvm_kwrite(3KVM)

kvm_nextproc(3KVM)

kvm_nlist(3KVM)

kvm_open(3KVM)

kvm_read(3KVM)

kvm_setproc(3KVM)

kvm_uread(3KVM)

kvm_uwrite(3KVM)

kvm_write(3KVM)

la_activity(3EXT)

la_amd64_pltenter(3EXT)

labelbuilder(3TSOL)

labelclipping(3TSOL)

label_to_str(3TSOL)

la_i86_pltenter(3EXT)

la_objfilter(3EXT)

la_objopen(3EXT)

la_objsearch(3EXT)

la_pltexit(3EXT)

la_pltexit64(3EXT)

la_preinit(3EXT)

la_sparcv8_pltenter(3EXT)

la_sparcv9_pltenter(3EXT)

la_symbind32(3EXT)

la_symbind64(3EXT)

la_version(3EXT)

ld_atexit(3ext)

ld_atexit64(3ext)

ldexp(3M)

ldexpf(3M)

ldexpl(3M)

ld_file(3ext)

ld_file64(3ext)

ld_input_done(3ext)

ld_input_section(3ext)

ld_input_section64(3ext)

ld_open(3ext)

ld_open64(3ext)

ld_section(3ext)

ld_section64(3ext)

ld_start(3ext)

ld_start64(3ext)

ld_support(3ext)

ld_version(3ext)

lgamma(3M)

lgammaf(3M)

lgammaf_r(3M)

lgammal(3M)

lgammal_r(3M)

lgamma_r(3M)

lgrp_affinity_get(3LGRP)

lgrp_affinity_set(3LGRP)

lgrp_children(3LGRP)

lgrp_cookie_stale(3LGRP)

lgrp_cpus(3LGRP)

lgrp_fini(3LGRP)

lgrp_home(3LGRP)

lgrp_init(3LGRP)

lgrp_latency(3LGRP)

lgrp_latency_cookie(3LGRP)

lgrp_mem_size(3LGRP)

lgrp_nlgrps(3LGRP)

lgrp_parents(3LGRP)

lgrp_resources(3LGRP)

lgrp_root(3LGRP)

lgrp_version(3LGRP)

lgrp_view(3LGRP)

libpicl(3PICL)

libpicltree(3PICLTREE)

libtecla_version(3TECLA)

libtnfctl(3TNF)

llrint(3M)

llrintf(3M)

llrintl(3M)

llround(3M)

llroundf(3M)

llroundl(3M)

log10(3M)

log10f(3M)

log10l(3M)

log1p(3M)

log1pf(3M)

log1pl(3M)

log2(3M)

log2f(3M)

log2l(3M)

log(3M)

logb(3M)

logbf(3M)

logbl(3M)

logf(3M)

logl(3M)

lrint(3M)

lrintf(3M)

lrintl(3M)

lround(3M)

lroundf(3M)

lroundl(3M)

maillock(3MAIL)

mailunlock(3MAIL)

match_execattr(3SECDB)

matherr(3M)

m_create_layout(3LAYOUT)

md4(3EXT)

MD4Final(3EXT)

MD4Init(3EXT)

MD4Update(3EXT)

md5(3EXT)

md5_calc(3EXT)

MD5Final(3EXT)

MD5Init(3EXT)

MD5Update(3EXT)

m_destroy_layout(3LAYOUT)

media_findname(3VOLMGT)

media_getattr(3VOLMGT)

media_getid(3VOLMGT)

media_setattr(3VOLMGT)

m_getvalues_layout(3LAYOUT)

mkdirp(3GEN)

m_label(3TSOL)

m_label_alloc(3TSOL)

m_label_dup(3TSOL)

m_label_free(3TSOL)

modf(3M)

modff(3M)

modfl(3M)

mp(3MP)

MP_AssignLogicalUnitToTPG(3MPAPI)

MP_CancelOverridePath(3MPAPI)

MP_CompareOIDs(3MPAPI)

MP_DeregisterForObjectPropertyChanges(3MPAPI)

MP_DeregisterForObjectVisibilityChanges(3MPAPI)

MP_DeregisterPlugin(3MPAPI)

MP_DisableAutoFailback(3MPAPI)

MP_DisableAutoProbing(3MPAPI)

MP_DisablePath(3MPAPI)

MP_EnableAutoFailback(3MPAPI)

MP_EnableAutoProbing(3MPAPI)

Extended Library Functions - Part 4

Extended Library Functions - Part 5

Extended Library Functions - Part 6

getprojent

, getprojbyname

, getprojbyid

, getdefaultproj

, inproj

, getprojidbyname

, setprojent

, endprojent

, fgetprojent

- project database entry operations

Synopsis

cc [ flag... ] file... -lproject [ library... ]
#include <project.h>

struct project *getprojent(struct project *proj, void *buffer,
     size_t bufsize);
struct project *getprojbyname(const char *name,
     struct project *proj, void *buffer, size_t bufsize);
struct project *getprojbyid(projid_t projid,
     struct project *proj, void *buffer, size_t bufsize);
struct project *getdefaultproj(const char *username,
     struct project *proj, void *buffer, size_t bufsize);
int inproj(const char *username, const char *projname,
     void *buffer, size_t bufsize);
projid_t getprojidbyname(const char *name);
void setprojent(void);
void endprojent(void);
struct project *fgetprojent(FILE *f, struct project *proj,
     void *buffer, size_t bufsize);

Description

These functions are used to obtain entries describing user projects. Entries can come from any of the sources for a project specified in the /etc/nsswitch.conf file (see nsswitch.conf(4)).

The setprojent(), getprojent(), and endprojent() functions are used to enumerate project entries from the database.

The setprojent() function effectively rewinds the project database to allow repeated searches. It sets (or resets) the enumeration to the beginning of the set of project entries. This function should be called before the first call to getprojent().

The getprojent() function returns a pointer to a structure containing the broken-out fields of an entry in the project database. When first called, getprojent() returns a pointer to a project structure containing the first project structure in the project database. Successive calls can be used to read the entire database.

The endprojent() function closes the project database and deallocates resources when processing is complete. It is permissible, though possibly less efficient, for the process to call more project functions after calling endprojent().

The getprojbyname() function searches the project database for an entry with the project name specified by the character string name.

The getprojbyid() function searches the project database for an entry with the (numeric) project ID specified by projid.

The getdefaultproj() function first looks up the project key word in the user_attr database used to define user attributes in restricted Solaris environments. If the database is available and the keyword is present, the function looks up the named project, returning NULL if it cannot be found or if the user is not a member of the named project. If absent, the function looks for a match in the project database for the special project user.username. If no match is found, or if the user is excluded from project user.username, the function looks at the default group entry of the passwd database for the user, and looks for a match in the project database for the special name group.groupname, where groupname is the default group associated with the password entry corresponding to the given username. If no match is found, or if the user is excluded from project group.groupname, the function returns NULL. A special project entry called 'default' can be looked up and used as a last resort, unless the user is excluded from project 'default'. On successful lookup, this function returns a pointer to the valid project structure. By convention, the user must have a default project defined on a system to be able to log on to that system.

The inproj() function checks if the user specified by username is able to use the project specified by projname. This function returns 1 if the user belongs to the list of project's users, if there is a project's group that contains the specified user, if project is a user's default project, or if project's user or group list contains “*” wildcard. In all other cases it returns 0.

The getprojidbyname() function searches the project database for an entry with the project name specified by the character string name. This function returns the project ID if the requested entry is found; otherwise it returns -1.

The fgetprojent() function, unlike the other functions described above, does not use nsswitch.conf; it reads and parses the next line from the stream f, which is assumed to have the format of the project(4) file. This function returns the same values as getprojent().

The getprojent(), getprojbyname(), getprojbyid(), getdefaultproj(), and inproj() functions are reentrant interfaces for operations with the project database. These functions use buffers supplied by the caller to store returned results and are safe for use in both single-threaded and multithreaded applications.

Reentrant interfaces require the additional arguments proj, buffer, and bufsize. The proj argument must be a pointer to a struct project structure allocated by the caller. On successful completion, the function returns the project entry in this structure. Storage referenced by the project structure is allocated from the memory provided with the buffer argument, which is bufsize bytes in size. The content of the memory buffer could be lost in cases when these functions return errors.

For enumeration in multithreaded applications, the position within the enumeration is a process-wide property shared by all threads. The setprojent() function can be used in a multithreaded application but resets the enumeration position for all threads. If multiple threads interleave calls to getprojent(), the threads will enumerate disjoint subsets of the project database. The inproj(), getprojbyname(), getprojbyid(), and getdefaultproj() functions leave the enumeration position in an indeterminate state.

Return Values

Project entries are represented by the struct project structure defined in <project.h>.

struct project {
    char      *pj_name;     /* name of the project */
    projid_t  pj_projid;    /* numerical project id */
    char      *pj_comment;  /* project comment */
    char      **pj_users;   /* vector of pointers to 
                               project user names */
    char      **pj_groups;  /* vector of pointers to 
                               project group names */
    char      *pj_attr;     /* project attributes */
};

The getprojbyname() and getprojbyid() functions each return a pointer to a struct project if they successfully locate the requested entry; otherwise they return NULL.

The getprojent() function returns a pointer to a struct project if it successfully enumerates an entry; otherwise it returns NULL, indicating the end of the enumeration.

The getprojidbyname() function returns the project ID if the requsted entry is found; otherwise it returns -1 and sets errno to indicate the error.

When the pointer returned by the reentrant functions getprojbyname(), getprojbyid(), and getprojent() is non-null, it is always equal to the proj pointer that was supplied by the caller.

Upon failure, NULL is returned and errno is set to indicate the error.

Errors

The getprojent(), getprojbyname(), getprojbyid(), inproj(), getprojidbyname(), fgetprojent(), and getdefaultproj() functions will fail if:

EINTR

A signal was caught during the operation.

EIO

An I/O error has occurred.

EMFILE

There are OPEN_MAX file descriptors currently open in the calling process.

ENFILE

The maximum allowable number of files is currently open in the system.

ERANGE

Insufficient storage was supplied by buffer and bufsize to contain the data to be referenced by the resulting project structure.

These functions can also fail if the name service switch does not specify valid project(4) name service sources. In the case of an incompletely configurated name service switch configuration, getprojbyid() and other functions can return error values other than those documented above. These conditions usually occur when the nsswitch.conf file indicates that one or more name services is providing entries for the project database when that name service does not actually make a project table available.

Usage

When compiling multithreaded applications, see Intro(3), Notes On Multithreaded Applications.

Use of the enumeration interface getprojent() is discouraged. Enumeration is supported for the project file, NIS, and LDAP but in general is not efficient. The semantics of enumeration are discussed further in nsswitch.conf(4).

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Evolving
MT-Level
See Description.

See Also

Intro(3), libproject(3LIB), project_walk(3PROJECT), sysconf(3C), nsswitch.conf(4), project(4), attributes(5)