ea_open man page on Solaris

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
Solaris logo
[printable version]

ea_open(3EXACCTExtended Accounting File Access Library Functioea_open(3EXACCT)

NAME
       ea_open, ea_close - open or close exacct files

SYNOPSIS
       cc [ flag... ] file... -lexacct [ library... ]
       #include <exacct.h>

       int  ea_open(ea_file_t  *ef, char *name, char *creator, int aflags, int
       oflags, mode_t mode);

       int ea_close(ea_file_t *ef);

DESCRIPTION
       The ea_open() function provides structured access to exacct files.  The
       aflags  argument	 contains  the	appropriate  exacct flags necessary to
       describe the file. The oflags and mode arguments contain the  appropri‐
       ate  flags  and	mode  to open the file; see <fcntl.h>. If ea_open() is
       invoked with EO_HEAD specified in aflags, the resulting file is	opened
       with  the  object  cursor  located  at the first object of the file. If
       ea_open() is invoked with EO_TAIL specified in  aflags,	the  resulting
       file is opened with the object cursor positioned beyond the last object
       in the file. If EO_NO_VALID_HDR is set in aflags	 along	with  EO_HEAD,
       the  initial header record will be returned as the first item read from
       the file. When creating a file, the  creator  argument  should  be  set
       (system	generated  files  use the value "SunOS"); when reading a file,
       this argument should be set to NULL if no validation is required;  oth‐
       erwise it should be set to the expected value in the file.

       The ea_close() function closes an open exacct file.

RETURN VALUES
       Upon  successful	 completion, ea_open() and ea_close() return 0. Other‐
       wise they return −1 and call ea_error(3EXACCT) to return	 the  extended
       accounting error value describing the error.

ERRORS
       The ea_open() and ea_close() functions may fail if:

       EXR_SYSCALL_FAIL	       A  system  call invoked by the function failed.
			       The errno variable contains the error value set
			       by the underlying call.

       The ea_open() function may fail if:

       EXR_CORRUPT_FILE	       The  file  referred  to	by name is not a valid
			       exacct file.

       EXR_NO_CREATOR	       In the case of file creation, the creator argu‐
			       ment  was  NULL.	  In  the  case	 of opening an
			       existing file, a creator argument was not  NULL
			       and  does  not  match  the  creator item of the
			       exacct file.

       EXR_UNKN_VERSION	       The file referred to by	name  uses  an	exacct
			       file  version  that cannot be processed by this
			       library.

USAGE
       The exacct file format can be used to represent data other than that in
       the  extended accounting format.	 By using a unique creator type in the
       file header, application writers can develop their own format suited to
       the needs of their application.

EXAMPLES
       Example 1: Open and close exacct file.

       The  following example opens the extended accounting data file for pro‐
       cesses. The exacct file is then closed.

       #include <exacct.h>

       ea_file_t ef;
       if (ea_open(&ef, "/var/adm/exacct/proc", NULL, EO_HEAD,
	   O_RDONLY, 0) == -1)
	       exit(1);
       (void) ea_close(&ef);

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

       ┌──────────────────────────┬────────────────────────────────┐
       │ATTRIBUTE TYPE		  │ ATTRIBUTE VALUE		   │
       ├──────────────────────────┼────────────────────────────────┤
       │Interface Stability	  │ Evolving			   │
       ├──────────────────────────┼────────────────────────────────┤
       │MT-Level		  │ MT-Safe			   │
       └──────────────────────────┴────────────────────────────────┘

SEE ALSO
       ea_error(3EXACCT),    ea_pack_object(3EXACCT),	 ea_set_item(3EXACCT),
       libexacct(3LIB), attributes(5)

SunOS 5.10			  29 Nov 2001		      ea_open(3EXACCT)
[top]

List of man pages available for Solaris

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net