typedef serial_t_guts Ref; typedef recsize_t ObjectOffset; typedef recsize_t ObjectSize; struct AnonProps { Ref pool; /* Ref<Pool> or Ref<Module> (same volume) */ }; struct RegProps { short nlink; mode_t mode; uid_t uid; gid_t gid; time_t atime; time_t mtime; time_t ctime; }; struct SysProps { lvid_t volume; /* like device */ Ref ref; /* like inode */ Ref type; ObjectSize csize; ObjectSize hsize; ObjectOffset tstart; int nindex; ObjectKind tag; union { // case KindAnonymous : AnonProps ap; // case KindRegistered : RegProps rp; // case KindTransient : } specific_u; }; // for registered objects: VASResult shore_vas::sysprops( const Path name, // Shore path -- SysProps *sysprops ); // for anonymous objects // or registered objects when not // following symlinks or cross-references // in the path lookup VASResult shore_vas::sysprops( const lrid_t &loid, SysProps *sysprops, bool wholepage=FALSE, LockMode lock=S, bool *is_unix_file=NULL, bool *page_cached=NULL );
The functions sysprops retrieve the system properties of an object, in the form of a sysprops structure.
The contents of the structure have the following meanings:
The second form is used for registered objects when their OIDs are known, and for anonymous objects. This form of sysprops has three arguments with default values.
Wholepage, if TRUE, requests the SVAS to bring an entire page of objects into the client's address space, if it can. This happens if and only if the requested object is anonymous, is a small object, and the caller is the client (not another value-added server). If the entire page is copied, the entire page is locked.
The argument lock can cause the SVAS to acquire a lock stronger lock than the default share lock on the object (or page of objects).
The argument is_unix_file is a pointer to a (pre-allocated) Boolean variable in the caller's address space. If the pointer is non-NULL, the SVAS returns TRUE if the object has a TEXT attribute.
In both forms, the system properties are written into the caller's address space at the location to which the argument sysprops points. This space must have been allocated by the caller prior to calling the function.
The argument page_cached is an (optional) output argument into which the SVAS writes true if the function resulted in a page of small (anonymous) objects being cached. See page(svas) for information about how to use the page of cached objects.
Sysprops can be used only in a transaction.
Deadlocks can occur while locks are being acquired. See transaction(svas) for information about deadlocks.
A complete list of errors is in errors(svas).