mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibC: Some compat fixes for GNU make.
This commit is contained in:
parent
f490ce0fb5
commit
e388808479
4 changed files with 24 additions and 5 deletions
|
@ -38,9 +38,6 @@ int _start(int argc, char** argv, char** env)
|
||||||
|
|
||||||
int status = main(argc, argv);
|
int status = main(argc, argv);
|
||||||
|
|
||||||
fflush(stdout);
|
|
||||||
fflush(stderr);
|
|
||||||
|
|
||||||
exit(status);
|
exit(status);
|
||||||
|
|
||||||
return 20150614;
|
return 20150614;
|
||||||
|
|
14
LibC/fcntl.h
14
LibC/fcntl.h
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
@ -54,4 +55,17 @@ __BEGIN_DECLS
|
||||||
|
|
||||||
int fcntl(int fd, int cmd, ...);
|
int fcntl(int fd, int cmd, ...);
|
||||||
|
|
||||||
|
#define F_WRLCK 1
|
||||||
|
#define F_UNLCK 2
|
||||||
|
|
||||||
|
#define F_SETLKW 7
|
||||||
|
|
||||||
|
struct flock {
|
||||||
|
short l_type;
|
||||||
|
short l_whence;
|
||||||
|
off_t l_start;
|
||||||
|
off_t l_len;
|
||||||
|
pid_t l_pid;
|
||||||
|
};
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
|
@ -440,7 +440,8 @@ int fclose(FILE* stream)
|
||||||
{
|
{
|
||||||
fflush(stream);
|
fflush(stream);
|
||||||
int rc = close(stream->fd);
|
int rc = close(stream->fd);
|
||||||
free(stream);
|
if (stream != &__default_streams[0] && stream != &__default_streams[1] && stream != &__default_streams[2] && stream != &__default_streams[3])
|
||||||
|
free(stream);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,6 +511,11 @@ int vfscanf(FILE* stream, const char* fmt, va_list ap)
|
||||||
return vsscanf(buffer, fmt, ap);
|
return vsscanf(buffer, fmt, ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FILE* tmpfile()
|
||||||
|
{
|
||||||
|
dbgprintf("FIXME: Implement tmpfile()\n");
|
||||||
|
ASSERT_NOT_REACHED();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@ void exit(int status)
|
||||||
__atexit_handlers[i]();
|
__atexit_handlers[i]();
|
||||||
extern void _fini();
|
extern void _fini();
|
||||||
_fini();
|
_fini();
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
_exit(status);
|
_exit(status);
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
@ -41,7 +43,7 @@ int atexit(void (*handler)())
|
||||||
void abort()
|
void abort()
|
||||||
{
|
{
|
||||||
// FIXME: Implement proper abort().
|
// FIXME: Implement proper abort().
|
||||||
exit(253);
|
CRASH();
|
||||||
}
|
}
|
||||||
|
|
||||||
char* getenv(const char* name)
|
char* getenv(const char* name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue