'\" te .\" Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. .TH getaccess_times 3C "9 May 2012" "SunOS 5.11" "Standard C Library Functions" .SH NAME getaccess_times \- return the time for a service used by the specified username. .SH SYNOPSIS .LP .nf #include \fBaccess_times_t *\fR\fIgetaccess_times\fR(\fBconst char *\fR\fIusername\fR, \fBconst char *\fR\fIservice\fR); .fi .SH DESCRIPTION .sp .LP The \fBgetaccess_times()\fR function returns the times for which the specified service may be used by the specified username. .sp .LP The internal representation of the time values is in a \fBaccess_times_t\fR structure defined in \fB\fR with the following members: .sp .in +2 .nf typedef struct access_times { struct { int start; int end; } range[7]; } access_times_t; .fi .in -2 .sp .LP The caller is responsible to free the returned \fBaccess_times_t\fR structure. .SH RETURN VALUES .sp .LP The entries in the range array correspond to the seven days of the week, beginning with Sunday. The start and end times indicate minutes since midnight. If the end time is less than the start time, then the end time applies to the following day. For days that have no valid range, both the start and end times are set to -1. .sp .LP If the username has no matching entry for the service then the function returns \fBNULL\fR. .SH USAGE .sp .LP The access time policies are specified using the \fBaccess_times\fR keyword in \fBuser_attr\fR(4) and \fBprof_attr\fR(4). The administrative interfaces are \fBusermod\fR(1M), \fBrolemod\fR(1M), and \fBprofiles\fR(1). The \fBgetaccess_times()\fR function is intended to be used to validate the policy with respect to the current time, which is retrieved via \fBlocaltime\fR(3C). By convention, if the \fBgetaccess_times()\fR function returns \fBNULL\fR, then no time restrictions apply for the service. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for description of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBusermod\fR(1M), \fBrolemod\fR(1M), \fBprofiles\fR(1), \fBpam_unix_account\fR(5), \fBuser_attr\fR(4), \fBprof_attr\fR(4), \fBattributes\fR(5)