Compare commits

..

No commits in common. "1db60b5a824cc31b90a29aac3cfb39c7ea680e19" and "dc169124cc4e16e993e06ffe39fcd2d11ba014fb" have entirely different histories.

5 changed files with 2 additions and 53 deletions

View File

@ -86,11 +86,7 @@ Result<int> luna_main(int argc, char** argv)
}
auto cmd = TRY(input_file->read_line());
if (cmd.is_empty())
{
puts("exit");
break;
}
if (cmd.is_empty()) break;
if (strspn(cmd.chars(), " \n") == cmd.length()) continue;

View File

@ -1,4 +1,4 @@
/* bits/timespec.h: The timespec and timeval structures. */
/* bits/timespec.h: The timespec structure. */
#ifndef _BITS_TIMESPEC_H
#define _BITS_TIMESPEC_H
@ -11,10 +11,4 @@ struct timespec
long tv_nsec;
};
struct timeval
{
time_t tv_sec;
suseconds_t tv_usec;
};
#endif

View File

@ -1,21 +0,0 @@
/* sys/time.h: POSIX time types. */
#ifndef _SYS_TIME_H
#define _SYS_TIME_H
#include <bits/attrs.h>
#include <bits/timespec.h>
#ifdef __cplusplus
extern "C"
{
#endif
/* Get the current time of day. */
__deprecated int gettimeofday(struct timeval* tp, void* timezone);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -19,7 +19,6 @@ typedef __u64_t ino_t;
typedef __u32_t uid_t;
typedef __u32_t gid_t;
typedef __u64_t nlink_t;
typedef __i64_t suseconds_t;
typedef off_t fpos_t;

View File

@ -1,8 +1,6 @@
#include <bits/errno-return.h>
#include <luna/Check.h>
#include <luna/Format.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
@ -150,21 +148,4 @@ extern "C"
{
return asctime(localtime(tp));
}
int gettimeofday(struct timeval* tp, void* timezone)
{
if (timezone)
{
fputs("gettimeofday: timezone was not NULL, abort\n", stderr);
abort();
}
struct timespec ts;
if (clock_gettime(CLOCK_REALTIME, &ts) < 0) return -1;
tp->tv_sec = ts.tv_sec;
tp->tv_usec = ts.tv_nsec / 1000;
return 0;
}
}