/titanic_41/usr/src/lib/libast/common/tm/ |
H A D | tmfix.c | 45 tmfix(register Tm_t* tm) in tmfix() argument 58 …if (w = !tm->tm_sec && !tm->tm_min && !tm->tm_mday && !tm->tm_year && !tm->tm_yday && !tm->tm_isds… in tmfix() 60 tm->tm_year = 99; in tmfix() 61 tm->tm_mday = 2; in tmfix() 68 if ((n = tm->tm_nsec) < 0) in tmfix() 70 tm->tm_sec -= (TMX_RESOLUTION - n) / TMX_RESOLUTION; in tmfix() 71 tm->tm_nsec = TMX_RESOLUTION - (-n) % TMX_RESOLUTION; in tmfix() 75 tm->tm_sec += n / TMX_RESOLUTION; in tmfix() 76 tm->tm_nsec %= TMX_RESOLUTION; in tmfix() 78 if ((n = tm->tm_sec) < 0) in tmfix() [all …]
|
H A D | tmxtime.c | 46 tmxtime(register Tm_t* tm, int west) in tmxtime() argument 54 struct tm* tl; in tmxtime() 58 ts = *tm; in tmxtime() 59 to = tm; in tmxtime() 60 tm = &ts; in tmxtime() 62 tmfix(tm); in tmxtime() 63 y = tm->tm_year; in tmxtime() 68 if ((n = tm->tm_mon) > 11) in tmxtime() 73 t += tm_data.sum[n] + tm->tm_mday - 1; in tmxtime() 75 t += tm->tm_hour; in tmxtime() [all …]
|
H A D | tmxdate.c | 124 powerize(Tm_t* tm, unsigned long p, unsigned long q, unsigned long u) in powerize() argument 138 tm->tm_nsec += (int)(t % TMX_RESOLUTION); in powerize() 139 tm->tm_sec += (int)(t / TMX_RESOLUTION); in powerize() 159 register Tm_t* tm; in tmxdate() local 209 tm = tmxtm(&ts, now, NiL); in tmxdate() 210 tm_info.date = tm->tm_zone; in tmxdate() 272 now = tmxtime(tm, zone); in tmxdate() 285 otm = *tm; in tmxdate() 318 tm->tm_sec += (365L*24L*60L*60L) * p / q; in tmxdate() 320 tm->tm_year += p; in tmxdate() [all …]
|
H A D | tmxmake.c | 40 tmxtm(register Tm_t* tm, Time_t t, Tm_zone_t* zone) in tmxtm() argument 42 register struct tm* tp; in tmxtm() 68 if (!(tm->tm_zone = zone)) in tmxtm() 71 tm->tm_zone = &tm_data.zone[2]; in tmxtm() 73 tm->tm_zone = tm_info.zone; in tmxtm() 75 if ((o = 60 * tm->tm_zone->west) && x > o) in tmxtm() 84 tm->tm_sec = n % 60 + leapsec; in tmxtm() 86 tm->tm_min = n % 60; in tmxtm() 88 tm->tm_hour = n % 24; in tmxtm() 91 tm->tm_sec = x % 60 + leapsec; in tmxtm() [all …]
|
H A D | tmweek.c | 55 tmweek(Tm_t* tm, int type, int week, int day) in tmweek() argument 61 if ((day = tm->tm_wday - tm->tm_yday % 7) < 0) in tmweek() 63 week = (tm->tm_yday + offset[day][type]) / 7; in tmweek() 67 week = (day > 0 && day < 6 || tmisleapyear(tm->tm_year - 1)) ? 53 : 52; in tmweek() 68 else if (week == 53 && (tm->tm_wday + (31 - tm->tm_mday)) < 4) in tmweek() 75 tm->tm_mon = 0; in tmweek() 76 tm->tm_mday = 1; in tmweek() 77 tmfix(tm); in tmweek() 78 d = tm->tm_wday; in tmweek() 79 tm->tm_mday = week * 7 - offset[d][type] + ((day || type != 2) ? day : 7); in tmweek() [all …]
|
H A D | tmxfmt.c | 116 Tm_t* tm; in tmxfmt() local 126 tm = tmxtm(&ts, t, NiL); in tmxfmt() 247 n = TM_DAY_ABBREV + tm->tm_wday; in tmxfmt() 250 n = TM_DAY + tm->tm_wday; in tmxfmt() 254 n = TM_MONTH_ABBREV + tm->tm_mon; in tmxfmt() 257 n = TM_MONTH + tm->tm_mon; in tmxfmt() 263 cp = number(cp, ep, (long)(1900 + tm->tm_year) / 100, 2, width, pad); in tmxfmt() 266 cp = number(cp, ep, (long)tm->tm_mday, 2, width, pad); in tmxfmt() 272 cp = number(cp, ep, (long)tm->tm_mday, 0, width, pad); in tmxfmt() 275 cp = number(cp, ep, (long)tm->tm_mday, -2, width, pad); in tmxfmt() [all …]
|
H A D | tmxscan.c | 74 gen(register Tm_t* tm, register Set_t* set) in gen() argument 81 tm->tm_year = set->year; in gen() 84 if (set->year < 0 && set->mon < tm->tm_mon) in gen() 85 tm->tm_year++; in gen() 86 tm->tm_mon = set->mon; in gen() 88 tm->tm_mday = set->mday = 1; in gen() 94 tmweek(tm, set->weektype, set->week, set->wday); in gen() 102 tm->tm_mon = 0; in gen() 103 tm->tm_mday = set->yday + 1; in gen() 107 tm->tm_mday = set->mday; in gen() [all …]
|
/titanic_41/usr/src/lib/libast/common/comp/ |
H A D | strftime.c | 50 strftime(char* buf, size_t len, const char* format, const struct tm* tm) 63 if (tm->tm_sec < 0 || tm->tm_sec > 60 || 64 tm->tm_min < 0 || tm->tm_min > 59 || 65 tm->tm_hour < 0 || tm->tm_hour > 23 || 66 tm->tm_wday < 0 || tm->tm_wday > 6 || 67 tm->tm_mday < 1 || tm->tm_mday > 31 || 68 tm->tm_mon < 0 || tm->tm_mon > 11 || 69 tm->tm_year < 0 || tm->tm_year > (2138 - 1900)) 71 if (tm->tm_sec >= 0 && tm->tm_sec <= 60) 72 tl.tm_sec = tm->tm_sec; [all …]
|
H A D | strptime.c | 48 strptime(const char* s, const char* format, struct tm* ts) 53 Tm_t tm; 55 memset(&tm, 0, sizeof(tm)); 56 tm.tm_sec = ts->tm_sec; 57 tm.tm_min = ts->tm_min; 58 tm.tm_hour = ts->tm_hour; 59 tm.tm_mday = ts->tm_mday; 60 tm.tm_mon = ts->tm_mon; 61 tm.tm_year = ts->tm_year; 62 tm.tm_wday = ts->tm_wday; [all …]
|
H A D | mktime.c | 50 mktime(struct tm* ts) 53 Tm_t tm; 55 tm.tm_sec = ts->tm_sec; 56 tm.tm_min = ts->tm_min; 57 tm.tm_hour = ts->tm_hour; 58 tm.tm_mday = ts->tm_mday; 59 tm.tm_mon = ts->tm_mon; 60 tm.tm_year = ts->tm_year; 61 tm.tm_wday = ts->tm_wday; 62 tm.tm_yday = ts->tm_yday; [all …]
|
H A D | getdate.c | 53 extern struct tm* 59 Tm_t* tm; 61 static struct tm ts; 70 tm = tmmake(&t); 71 ts.tm_sec = tm->tm_sec; 72 ts.tm_min = tm->tm_min; 73 ts.tm_hour = tm->tm_hour; 74 ts.tm_mday = tm->tm_mday; 75 ts.tm_mon = tm->tm_mon; 76 ts.tm_year = tm->tm_year; [all …]
|
/titanic_41/usr/src/cmd/localedef/ |
H A D | time.c | 31 struct lc_time tm; variable 36 (void) memset(&tm, 0, sizeof (tm)); in init_time() 52 tm.c_fmt = str; in add_time_str() 55 tm.x_fmt = str; in add_time_str() 58 tm.X_fmt = str; in add_time_str() 61 tm.ampm_fmt = str; in add_time_str() 68 tm.date_fmt = str; in add_time_str() 108 add_list(tm.mon, str, 12); in add_time_list() 111 add_list(tm.month, str, 12); in add_time_list() 114 add_list(tm.wday, str, 7); in add_time_list() [all …]
|
/titanic_41/usr/src/lib/libbc/libc/gen/common/ |
H A D | strptime.c | 50 strptime(buf, format, tm) in strptime() argument 53 struct tm *tm; 88 tm->tm_wday = i; 107 tm->tm_mon = i; 112 cp = strptime(cp, "%x %X", tm); 118 cp = strptime(cp, dtcp->ldate_format, tm); 125 cp = cvtnum(cp, &tm->tm_mday); 128 if (tm->tm_mday > 31) 136 cp = strptime(cp, "%m/%d/%y", tm); 143 cp = cvtnum(cp, &tm->tm_hour); [all …]
|
H A D | strftime.c | 61 strftime(buf, maxsize, format, tm) in strftime() argument 63 struct tm *tm; 87 for (p = dtcp->abbrev_weekday_names[tm->tm_wday]; 96 for (p = dtcp->weekday_names[tm->tm_wday]; 106 for (p = dtcp->abbrev_month_names[tm->tm_mon]; 115 for (p = dtcp->month_names[tm->tm_mon]; 124 i = strftime(cp, maxsize - size, "%x %X", tm); 133 dtcp->ldate_format, tm); 143 cp = itoa(tm->tm_mday, cp, 2); 148 tm); [all …]
|
/titanic_41/usr/src/lib/libc/port/locale/ |
H A D | strptime.c | 55 struct tm *_RESTRICT_KYWD tm, int *_RESTRICT_KYWD flagsp, in __strptime() argument 96 buf = __strptime(buf, tptr->date_fmt, tm, flagsp, loc); in __strptime() 115 tm->tm_year = i * 100 - 1900; in __strptime() 119 buf = __strptime(buf, tptr->c_fmt, tm, flagsp, loc); in __strptime() 125 buf = __strptime(buf, "%m/%d/%y", tm, flagsp, loc); in __strptime() 143 buf = __strptime(buf, "%Y-%m-%d", tm, flagsp, loc); in __strptime() 149 buf = __strptime(buf, "%H:%M", tm, flagsp, loc); in __strptime() 155 buf = __strptime(buf, tptr->ampm_fmt, tm, flagsp, loc); in __strptime() 161 buf = __strptime(buf, "%H:%M:%S", tm, flagsp, loc); in __strptime() 167 buf = __strptime(buf, tptr->X_fmt, tm, flagsp, loc); in __strptime() [all …]
|
H A D | getdate.c | 64 struct tm * 70 static struct tm rtm, tmnow; in getdate() 71 struct tm *tmp, *rtmp = &rtm; in getdate() 196 struct tm tm; in getdate() local 198 (void) memset(&tm, 0, sizeof (struct tm)); in getdate() 199 tm.tm_year = rtm.tm_year; in getdate() 200 tm.tm_mon = rtm.tm_mon; in getdate() 201 tm.tm_mday = 1; in getdate() 202 (void) mktime(&tm); in getdate() 204 (rtm.tm_wday - tm.tm_wday + 7) % 7; in getdate() [all …]
|
/titanic_41/usr/src/uts/common/fs/tmpfs/ |
H A D | tmp_vfsops.c | 235 struct tmount *tm = NULL; in tmp_mount() local 289 if ((tm = tmp_memalloc(sizeof (struct tmount), 0)) == NULL) { in tmp_mount() 301 tm->tm_dev = makedevice(tmpfs_major, tmpfs_minor); in tmp_mount() 302 } while (vfs_devismounted(tm->tm_dev)); in tmp_mount() 309 mutex_init(&tm->tm_contents, NULL, MUTEX_DEFAULT, NULL); in tmp_mount() 310 mutex_init(&tm->tm_renamelck, NULL, MUTEX_DEFAULT, NULL); in tmp_mount() 312 tm->tm_vfsp = vfsp; in tmp_mount() 313 tm->tm_anonmax = anonmax; in tmp_mount() 315 vfsp->vfs_data = (caddr_t)tm; in tmp_mount() 317 vfsp->vfs_dev = tm->tm_dev; in tmp_mount() [all …]
|
H A D | tmp_tnode.c | 61 struct tmount *tm, in tmp_resv() argument 80 zone = tm->tm_vfsp->vfs_zone; in tmp_resv() 81 if (pagecreate && ((tm->tm_anonmem + pages > tm->tm_anonmax) || in tmp_resv() 91 mutex_enter(&tm->tm_contents); in tmp_resv() 92 tm->tm_anonmem += pages; in tmp_resv() 93 mutex_exit(&tm->tm_contents); in tmp_resv() 109 struct tmount *tm, in tmp_unresv() argument 116 anon_unresv_zone(delta, tm->tm_vfsp->vfs_zone); in tmp_unresv() 118 mutex_enter(&tm->tm_contents); in tmp_unresv() 119 tm->tm_anonmem -= btopr(delta); in tmp_unresv() [all …]
|
/titanic_41/usr/src/cmd/touch/ |
H A D | touch.c | 282 struct tm tm; in parse_datetime() local 326 (void) memset(&tm, 0, sizeof (struct tm)); in parse_datetime() 328 tm.tm_year = atoi(year) - 1900; in parse_datetime() 329 tm.tm_mon = atoi(month) - 1; in parse_datetime() 330 tm.tm_mday = atoi(day); in parse_datetime() 331 tm.tm_hour = atoi(hour); in parse_datetime() 332 tm.tm_min = atoi(minute); in parse_datetime() 333 tm.tm_sec = atoi(second); in parse_datetime() 340 if ((when = mktime(&tm)) == -1 && errno != 0) in parse_datetime() 342 if (tm.tm_isdst) in parse_datetime() [all …]
|
/titanic_41/usr/src/cmd/zdump/ |
H A D | zdump.c | 94 static char *abbr(struct tm *); 96 static long delta(struct tm *, struct tm *); 97 static void dumptime(const struct tm *); 108 static struct tm * 112 register struct tm *tmp; 116 struct tm tm; local 119 tm = *tmp; 120 t = mktime(&tm); 190 struct tm tm; local 191 struct tm newtm; [all …]
|
/titanic_41/usr/src/head/ |
H A D | time.h | 54 using std::tm; 83 extern struct tm *gmtime_r(const time_t *_RESTRICT_KYWD, 84 struct tm *_RESTRICT_KYWD); 85 extern struct tm *localtime_r(const time_t *_RESTRICT_KYWD, 86 struct tm *_RESTRICT_KYWD); 96 extern char *__strptime_dontzero(const char *, const char *, struct tm *); 102 struct tm *_RESTRICT_KYWD); 181 extern time_t timegm(struct tm *); 183 extern int ascftime(char *, const char *, const struct tm *); 189 extern struct tm *getdate(const char *); [all …]
|
/titanic_41/usr/src/cmd/backup/lib/ |
H A D | getdate.y | 582 struct tm *tm; local 586 tm = localtime(&now); 587 now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); 598 struct tm *tm; local 604 tm = localtime(&Start); 605 Month = 12 * tm->tm_year + tm->tm_mon + RelMonth; 609 Convert(Month, (time_t)tm->tm_mday, Year, 610 (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec, 726 struct tm *tm; local 772 tm = localtime(&now); [all …]
|
/titanic_41/usr/src/lib/libast/common/sfio/ |
H A D | sfpkrd.c | 40 ssize_t sfpkrd(int fd, Void_t* argbuf, size_t n, int rc, long tm, int action) in sfpkrd() argument 42 ssize_t sfpkrd(fd, argbuf, n, rc, tm, action) in sfpkrd() 47 long tm; /* time-out */ 58 if(rc < 0 && tm < 0 && action <= 0) 73 if((t&STREAM_PEEK) && (ntry == 1 || tm < 0) ) 108 while(tm >= 0 || action > 0 || 122 if((r = SFPOLL(&po,1,tm)) < 0) 144 if(tm < 0) 148 tmb.tv_sec = tm/SECOND; 149 tmb.tv_usec = (tm%SECOND)*SECOND; [all …]
|
/titanic_41/usr/src/cmd/oamuser/lib/ |
H A D | vexpire.c | 45 struct tm *tm; local 53 tm = localtime( &now ); 54 now -= tm->tm_hour * 60*60 + tm->tm_min * 60 + tm->tm_sec;
|
/titanic_41/usr/src/cmd/rtc/ |
H A D | rtc.c | 162 struct tm *tm; in set_zone() local 183 tm = localtime(&clock_val); in set_zone() 184 current_lag = tm->tm_isdst ? altzone : timezone; in set_zone() 186 (void) printf("%s DST. Lag is %ld.\n", tm->tm_isdst ? "Is" : in set_zone() 187 "Is NOT", tm->tm_isdst ? altzone : timezone); in set_zone() 192 tm->tm_isdst ? altzone : timezone); in set_zone() 201 struct tm *tm; in correct_rtc_and_lag() local 218 tm = localtime(&clock_val); in correct_rtc_and_lag() 219 current_lag = tm->tm_isdst ? altzone : timezone; in correct_rtc_and_lag()
|