* defs.h (sprinttime): New prototype.
* file.c (sprinttime): Make global and move to util.c.
extern int printflags(const struct xlat *, int, const char *);
extern const char *sprintflags(const char *, const struct xlat *, int);
extern const char *sprintmode(int);
+extern const char *sprinttime(time_t);
extern void dumpiov_in_msghdr(struct tcb *, long);
extern void dumpiov_in_mmsghdr(struct tcb *, long);
extern void dumpiov(struct tcb *, int, long);
/* several stats */
-static char *
-sprinttime(time_t t)
-{
- struct tm *tmp;
- static char buf[sizeof("yyyy/mm/dd-hh:mm:ss")];
-
- if (t == 0) {
- strcpy(buf, "0");
- return buf;
- }
- tmp = localtime(&t);
- if (tmp)
- snprintf(buf, sizeof buf, "%02d/%02d/%02d-%02d:%02d:%02d",
- tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
- tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
- else
- snprintf(buf, sizeof buf, "%lu", (unsigned long) t);
-
- return buf;
-}
-
#if defined(SPARC) || defined(SPARC64)
typedef struct {
int tv_sec;
tprints("]");
}
+const char *
+sprinttime(time_t t)
+{
+ struct tm *tmp;
+ static char buf[sizeof("yyyy/mm/dd-hh:mm:ss")];
+
+ if (t == 0) {
+ strcpy(buf, "0");
+ return buf;
+ }
+ tmp = localtime(&t);
+ if (tmp)
+ snprintf(buf, sizeof buf, "%02d/%02d/%02d-%02d:%02d:%02d",
+ tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+ else
+ snprintf(buf, sizeof buf, "%lu", (unsigned long) t);
+
+ return buf;
+}
+
static char *
getfdproto(struct tcb *tcp, int fd, char *buf, unsigned bufsize)
{