Browse Source

Add libc wrappers for some syscalls, remove unused syscall.h imports

K. Lange 3 years ago
parent
commit
ae6532607a

+ 6 - 2
apps/bim.c

@@ -26,7 +26,7 @@
 #include <stdio_ext.h>
 #define BACKSPACE_KEY 0x7F
 #else
-#include <syscall.h>
+#include <sys/fswait.h>
 #define BACKSPACE_KEY 0x08
 #endif
 
@@ -70,12 +70,16 @@ int bim_getch(void) {
 		return out;
 	}
 	int fds[] = {STDIN_FILENO};
-	int index = syscall_fswait2(1,fds,200);
+#ifdef __linux__
+#error Need to replace fswait2 with select/poll
+#else
+	int index = fswait2(1,fds,200);
 	if (index == 0) {
 		return fgetc(stdin);
 	} else {
 		return -1;
 	}
+#endif
 }
 
 typedef struct _env {

+ 3 - 2
apps/compositor.c

@@ -29,6 +29,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/fswait.h>
 #include <pthread.h>
 
 #include <toaru/graphics.h>
@@ -2012,7 +2013,7 @@ int main(int argc, char * argv[]) {
 
 	while (1) {
 		if (yutani_options.nested) {
-			int index = syscall_fswait(2, fds);
+			int index = fswait(2, fds);
 
 			if (index == 1) {
 				yutani_msg_t * m = yutani_poll(yg->host_context);
@@ -2069,7 +2070,7 @@ int main(int argc, char * argv[]) {
 				continue;
 			}
 		} else {
-			int index = syscall_fswait(amfd == -1 ? 3 : 4, fds);
+			int index = fswait(amfd == -1 ? 3 : 4, fds);
 
 			if (index == 2) {
 				unsigned char buf[1];

+ 2 - 2
apps/drawlines.c

@@ -8,10 +8,10 @@
  */
 #include <stdlib.h>
 #include <assert.h>
-#include <syscall.h>
 #include <unistd.h>
 #include <pthread.h>
 #include <time.h>
+#include <sched.h>
 
 #include <toaru/yutani.h>
 #include <toaru/graphics.h>
@@ -67,7 +67,7 @@ int main (int argc, char ** argv) {
 						struct yutani_msg_key_event * ke = (void*)m->data;
 						if (ke->event.action == KEY_ACTION_DOWN && ke->event.keycode == 'q') {
 							should_exit = 1;
-							syscall_yield();
+							sched_yield();
 						}
 					}
 					break;

+ 4 - 3
apps/getty.c

@@ -5,7 +5,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <syscall.h>
+#include <pty.h>
+#include <sys/fswait.h>
 
 int main(int argc, char * argv[]) {
 	int fd_master, fd_slave, fd_serial;
@@ -22,7 +23,7 @@ int main(int argc, char * argv[]) {
 			file = argv[1];
 		}
 
-		syscall_openpty(&fd_master, &fd_slave, NULL, NULL, NULL);
+		openpty(&fd_master, &fd_slave, NULL, NULL, NULL);
 		fd_serial = open(file, O_RDWR);
 
 		if (!fork()) {
@@ -40,7 +41,7 @@ int main(int argc, char * argv[]) {
 			int fds[2] = {fd_serial, fd_master};
 
 			while (1) {
-				int index = syscall_fswait2(2,fds,200);
+				int index = fswait2(2,fds,200);
 				char buf[1024];
 				int r;
 				switch (index) {

+ 0 - 1
apps/gsudo.c

@@ -11,7 +11,6 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <syscall.h>
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>

+ 2 - 2
apps/irc.c

@@ -8,13 +8,13 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <syscall.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <termios.h>
 #include <va_list.h>
 #include <time.h>
 #include <string.h>
+#include <sys/fswait.h>
 
 #define _ITALIC "\033[3m"
 #define _END    "\033[0m\n"
@@ -495,7 +495,7 @@ int main(int argc, char * argv[]) {
 	int buf_p = 0;
 
 	while (1) {
-		int index = syscall_fswait2(2,fds,200);
+		int index = fswait2(2,fds,200);
 
 		if (index == 1) {
 			/* stdin */

+ 0 - 1
apps/julia.c

@@ -11,7 +11,6 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <syscall.h>
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>

+ 0 - 1
apps/live-session.c

@@ -1,7 +1,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
-#include <syscall.h>
 #include <signal.h>
 #include <errno.h>
 #include <sys/wait.h>

+ 0 - 1
apps/ls.c

@@ -15,7 +15,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <syscall.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <termios.h>

+ 2 - 2
apps/panel.c

@@ -22,12 +22,12 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <signal.h>
-#include <syscall.h>
 #include <sys/time.h>
 #include <sys/utsname.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
+#include <sys/fswait.h>
 
 #include <toaru/yutani.h>
 #include <toaru/graphics.h>
@@ -1222,7 +1222,7 @@ int main (int argc, char ** argv) {
 
 	while (_continue) {
 
-		int index = syscall_fswait2(1,fds,200);
+		int index = fswait2(1,fds,200);
 
 		if (index == 0) {
 			/* Respond to Yutani events */

+ 2 - 2
apps/plasma.c

@@ -10,9 +10,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <math.h>
-#include <syscall.h>
 #include <wait.h>
 #include <pthread.h>
+#include <sched.h>
 
 #include <toaru/yutani.h>
 #include <toaru/graphics.h>
@@ -85,7 +85,7 @@ void * draw_thread(void * garbage) {
 		flip(ctx);
 		yutani_flip(yctx, wina);
 		spin_unlock(&draw_lock);
-		syscall_yield();
+		sched_yield();
 	}
 	return NULL;
 }

+ 2 - 2
apps/pong.c

@@ -23,7 +23,7 @@
 #include <fcntl.h>
 #include <time.h>
 #include <math.h>
-#include <syscall.h>
+#include <sched.h>
 #include <sys/time.h>
 
 #include <toaru/yutani.h>
@@ -295,7 +295,7 @@ int main (int argc, char ** argv) {
 			}
 			free(m);
 		} else {
-			syscall_yield();
+			sched_yield();
 		}
 	}
 

+ 0 - 1
apps/ps.c

@@ -15,7 +15,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <syscall.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <pwd.h>

+ 0 - 1
apps/pstree.c

@@ -15,7 +15,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <syscall.h>
 #include <unistd.h>
 #include <dirent.h>
 

+ 0 - 1
apps/sdf-demo.c

@@ -6,7 +6,6 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <syscall.h>
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>

+ 2 - 2
apps/serial-console.c

@@ -12,12 +12,12 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syscall.h>
 #include <signal.h>
 #include <string.h>
 #include <termios.h>
 #include <fcntl.h>
 #include <sys/wait.h>
+#include <sys/fswait.h>
 
 int fd = 0;
 
@@ -91,7 +91,7 @@ int main(int argc, char ** argv) {
 	int fds[2] = {STDIN_FILENO, fd};
 
 	while (1) {
-		int index = syscall_fswait(2, fds);
+		int index = fswait(2, fds);
 
 		if (index == -1) {
 			fprintf(stderr, "serial-console: fswait: erroneous file descriptor\n");

+ 0 - 1
apps/session.c

@@ -1,7 +1,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
-#include <syscall.h>
 #include <signal.h>
 #include <errno.h>
 #include <sys/wait.h>

+ 0 - 1
apps/stat.c

@@ -9,7 +9,6 @@
  */
 #include <stdio.h>
 #include <sys/stat.h>
-#include <syscall.h>
 #include <stdint.h>
 #include <string.h>
 

+ 0 - 1
apps/sudo.c

@@ -9,7 +9,6 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <syscall.h>
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>

+ 4 - 12
apps/terminal-vga.c

@@ -8,7 +8,6 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <syscall.h>
 #include <string.h>
 #include <stdlib.h>
 #include <signal.h>
@@ -21,6 +20,8 @@
 #include <sys/wait.h>
 #include <getopt.h>
 #include <errno.h>
+#include <pty.h>
+#include <sys/fswait.h>
 
 #include <wchar.h>
 
@@ -631,15 +632,6 @@ void term_write(char c) {
 			draw_cursor();
 		} else if (c == '\007') {
 			/* bell */
-#if USE_BELL
-			for (int i = 0; i < term_height; ++i) {
-				for (int j = 0; j < term_width; ++j) {
-					cell_redraw_inverted(j, i);
-				}
-			}
-			syscall_nanosleep(0,10);
-			term_redraw_all();
-#endif
 		} else if (c == '\b') {
 			if (csr_x > 0) {
 				--csr_x;
@@ -1038,7 +1030,7 @@ int main(int argc, char ** argv) {
 
 	putenv("TERM=toaru");
 
-	syscall_openpty(&fd_master, &fd_slave, NULL, NULL, NULL);
+	openpty(&fd_master, &fd_slave, NULL, NULL, NULL);
 
 	terminal = fdopen(fd_slave, "w");
 
@@ -1116,7 +1108,7 @@ int main(int argc, char ** argv) {
 		unsigned char buf[1024];
 		while (!exit_application) {
 
-			int index = syscall_fswait2(amfd == -1 ? 3 : 4,fds,200);
+			int index = fswait2(amfd == -1 ? 3 : 4,fds,200);
 
 			check_for_exit();
 

+ 9 - 41
apps/terminal.c

@@ -17,19 +17,21 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <syscall.h>
 #include <string.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <time.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <getopt.h>
+#include <errno.h>
+#include <pty.h>
+
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <sys/time.h>
-#include <getopt.h>
-#include <errno.h>
+#include <sys/fswait.h>
 
 #include <wchar.h>
 
@@ -49,9 +51,6 @@
 #include "terminal-palette.h"
 #include "terminal-font.h"
 
-
-#define USE_BELL 0
-
 /* master and slave pty descriptors */
 static int fd_master, fd_slave;
 static FILE * terminal;
@@ -74,7 +73,6 @@ uint8_t  _fullscreen    = 0;    /* Whether or not we are running in fullscreen m
 uint8_t  _no_frame      = 0;    /* Whether to disable decorations or not */
 uint8_t  _login_shell   = 0;    /* Whether we're going to display a login shell or not */
 uint8_t  _use_sdf       = 1;    /* Whether or not to use SDF text rendering */
-uint8_t  _force_kernel  = 0;
 uint8_t  _hold_out      = 0;    /* state indicator on last cell ignore \n */
 uint8_t  _free_size     = 1;    /* Disable rounding when resized */
 
@@ -985,15 +983,7 @@ void term_write(char c) {
 			draw_cursor();
 		} else if (c == '\007') {
 			/* bell */
-#if USE_BELL
-			for (int i = 0; i < term_height; ++i) {
-				for (int j = 0; j < term_width; ++j) {
-					cell_redraw_inverted(j, i);
-				}
-			}
-			syscall_nanosleep(0,10);
-			term_redraw_all();
-#endif
+			/* XXX play sound */
 		} else if (c == '\b') {
 			if (csr_x > 0) {
 				--csr_x;
@@ -1159,19 +1149,6 @@ void term_clear(int i) {
 	flush_unused_images();
 }
 
-#if 0
-char * loadMemFont(char * name, char * ident, size_t * size) {
-	size_t s = 0;
-	int error;
-	char tmp[100];
-	snprintf(tmp, 100, "sys.%s.fonts.%s", yctx->server_ident, ident);
-
-	char * font = (char *)syscall_shm_obtain(tmp, &s);
-	*size = s;
-	return font;
-}
-#endif
-
 #define INPUT_SIZE 1024
 char input_buffer[INPUT_SIZE];
 int  input_collected = 0;
@@ -1850,7 +1827,6 @@ int main(int argc, char ** argv) {
 		{"scale",      required_argument, 0, 's'},
 		{"login",      no_argument,       0, 'l'},
 		{"help",       no_argument,       0, 'h'},
-		{"kernel",     no_argument,       0, 'k'},
 		{"grid",       no_argument,       0, 'x'},
 		{"no-frame",   no_argument,       0, 'n'},
 		{"geometry",   required_argument, 0, 'g'},
@@ -1859,16 +1835,13 @@ int main(int argc, char ** argv) {
 
 	/* Read some arguments */
 	int index, c;
-	while ((c = getopt_long(argc, argv, "bhxnFlks:g:", long_opts, &index)) != -1) {
+	while ((c = getopt_long(argc, argv, "bhxnFls:g:", long_opts, &index)) != -1) {
 		if (!c) {
 			if (long_opts[index].flag == 0) {
 				c = long_opts[index].val;
 			}
 		}
 		switch (c) {
-			case 'k':
-				_force_kernel = 1;
-				break;
 			case 'x':
 				_free_size = 0;
 				break;
@@ -2001,7 +1974,7 @@ int main(int argc, char ** argv) {
 
 	yutani_window_move(yctx, window, yctx->display_width / 2 - window->width / 2, yctx->display_height / 2 - window->height / 2);
 
-	syscall_openpty(&fd_master, &fd_slave, NULL, NULL, NULL);
+	openpty(&fd_master, &fd_slave, NULL, NULL, NULL);
 
 	terminal = fdopen(fd_slave, "w");
 
@@ -2040,11 +2013,6 @@ int main(int argc, char ** argv) {
 		return 1;
 	} else {
 
-		if (_force_kernel) {
-			/* Request kernel output to this terminal */
-			//syscall_system_function(4, (char **)fd_slave);
-		}
-
 		child_pid = f;
 
 		int fds[2] = {fileno(yctx->sock), fd_master};
@@ -2052,7 +2020,7 @@ int main(int argc, char ** argv) {
 		unsigned char buf[1024];
 		while (!exit_application) {
 
-			int index = syscall_fswait2(2,fds,200);
+			int index = fswait2(2,fds,200);
 
 			check_for_exit();
 

+ 2 - 2
apps/ttysize.c

@@ -4,7 +4,7 @@
 #include <getopt.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
-#include <syscall.h>
+#include <sys/fswait.h>
 
 static struct termios old;
 
@@ -21,7 +21,7 @@ static void set_buffered() {
 
 static int getc_timeout(FILE * f, int timeout) {
 	int fds[1] = {fileno(f)};
-	int index = syscall_fswait2(1,fds,timeout);
+	int index = fswait2(1,fds,timeout);
 	if (index == 0) {
 		return fgetc(f);
 	} else {

+ 0 - 1
apps/uname.c

@@ -9,7 +9,6 @@
  * Prints the kernel version information.
  */
 #include <stdio.h>
-#include <syscall.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/utsname.h>

+ 0 - 1
apps/yutani-test.c

@@ -10,7 +10,6 @@
  */
 #include <stdlib.h>
 #include <assert.h>
-#include <syscall.h>
 #include <unistd.h>
 
 #include <toaru/yutani.h>

+ 4 - 0
base/usr/include/pty.h

@@ -0,0 +1,4 @@
+#pragma once
+#include <sys/ioctl.h>
+
+extern int openpty(int * amaster, int * aslave, char * name, const struct termios *termp, const struct winsize * winp);

+ 3 - 0
base/usr/include/sched.h

@@ -0,0 +1,3 @@
+#pragma once
+
+extern int sched_yield(void);

+ 4 - 0
base/usr/include/sys/fswait.h

@@ -0,0 +1,4 @@
+#pragma once
+
+extern int fswait(int count, int * fds);
+extern int fswait2(int count, int * fds, int timeout);

+ 15 - 15
lib/graphics.c

@@ -5,13 +5,13 @@
  * Generic Graphics library for ToaruOS
  */
 
-#include <syscall.h>
 #include <stdint.h>
-
-#include <sys/ioctl.h>
 #include <string.h>
 #include <stdio.h>
 #include <math.h>
+#include <fcntl.h>
+
+#include <sys/ioctl.h>
 
 #include <xmmintrin.h>
 #include <emmintrin.h>
@@ -87,7 +87,7 @@ gfx_context_t * init_graphics_fullscreen() {
 	out->clips = NULL;
 
 	if (!framebuffer_fd) {
-		framebuffer_fd = syscall_open("/dev/fb0", 0, 0);
+		framebuffer_fd = open("/dev/fb0", 0, 0);
 	}
 	if (framebuffer_fd < 0) {
 		/* oh shit */
@@ -95,11 +95,11 @@ gfx_context_t * init_graphics_fullscreen() {
 		return NULL;
 	}
 
-	syscall_ioctl(framebuffer_fd, IO_VID_WIDTH,  &out->width);
-	syscall_ioctl(framebuffer_fd, IO_VID_HEIGHT, &out->height);
-	syscall_ioctl(framebuffer_fd, IO_VID_DEPTH,  &out->depth);
-	syscall_ioctl(framebuffer_fd, IO_VID_ADDR,   &out->buffer);
-	syscall_ioctl(framebuffer_fd, IO_VID_SIGNAL, NULL);
+	ioctl(framebuffer_fd, IO_VID_WIDTH,  &out->width);
+	ioctl(framebuffer_fd, IO_VID_HEIGHT, &out->height);
+	ioctl(framebuffer_fd, IO_VID_DEPTH,  &out->depth);
+	ioctl(framebuffer_fd, IO_VID_ADDR,   &out->buffer);
+	ioctl(framebuffer_fd, IO_VID_SIGNAL, NULL);
 
 	out->size   = GFX_H(out) * GFX_W(out) * GFX_B(out);
 	out->backbuffer = out->buffer;
@@ -108,7 +108,7 @@ gfx_context_t * init_graphics_fullscreen() {
 
 uint32_t framebuffer_stride(void) {
 	uint32_t stride;
-	syscall_ioctl(framebuffer_fd, IO_VID_STRIDE, &stride);
+	ioctl(framebuffer_fd, IO_VID_STRIDE, &stride);
 	return stride;
 }
 
@@ -121,9 +121,9 @@ gfx_context_t * init_graphics_fullscreen_double_buffer() {
 
 void reinit_graphics_fullscreen(gfx_context_t * out) {
 
-	syscall_ioctl(framebuffer_fd, IO_VID_WIDTH,  &out->width);
-	syscall_ioctl(framebuffer_fd, IO_VID_HEIGHT, &out->height);
-	syscall_ioctl(framebuffer_fd, IO_VID_DEPTH,  &out->depth);
+	ioctl(framebuffer_fd, IO_VID_WIDTH,  &out->width);
+	ioctl(framebuffer_fd, IO_VID_HEIGHT, &out->height);
+	ioctl(framebuffer_fd, IO_VID_DEPTH,  &out->depth);
 
 	out->size = GFX_H(out) * GFX_W(out) * GFX_B(out);
 
@@ -134,10 +134,10 @@ void reinit_graphics_fullscreen(gfx_context_t * out) {
 	}
 
 	if (out->buffer != out->backbuffer) {
-		syscall_ioctl(framebuffer_fd, IO_VID_ADDR,   &out->buffer);
+		ioctl(framebuffer_fd, IO_VID_ADDR,   &out->buffer);
 		out->backbuffer = realloc(out->backbuffer, sizeof(uint32_t) * GFX_W(out) * GFX_H(out));
 	} else {
-		syscall_ioctl(framebuffer_fd, IO_VID_ADDR,   &out->buffer);
+		ioctl(framebuffer_fd, IO_VID_ADDR,   &out->buffer);
 		out->backbuffer = out->buffer;
 	}
 

+ 0 - 3
lib/termemu.c

@@ -23,12 +23,9 @@ static void _spin_unlock(volatile int * foo) { return; }
 #include <string.h>
 #include <stdio.h>
 
-#include <syscall.h>
-
 #include <toaru/graphics.h>
 #include <toaru/termemu.h>
 
-
 #include <toaru/spinlock.h>
 #define _spin_lock spin_lock
 #define _spin_unlock spin_unlock

+ 0 - 4
libc/main.c

@@ -10,7 +10,6 @@ DEFN_SYSCALL2(gettimeofday, 6, void *, void *);
 DEFN_SYSCALL3(execve, 7, char *, char **, char **);
 DEFN_SYSCALL1(sbrk, 10, int);
 DEFN_SYSCALL0(getgraphicsaddress, 11);
-DEFN_SYSCALL5(openpty, 13, int *, int *, char *, void *, void *);
 DEFN_SYSCALL1(setgraphicsoffset, 16, int);
 DEFN_SYSCALL1(wait, 17, unsigned int);
 DEFN_SYSCALL0(getgraphicswidth,  18);
@@ -28,7 +27,6 @@ DEFN_SYSCALL1(shm_release, 36, char *);
 DEFN_SYSCALL2(share_fd, 39, int, int);
 DEFN_SYSCALL1(get_fd, 40, int);
 DEFN_SYSCALL0(gettid, 41);
-DEFN_SYSCALL0(yield, 42);
 DEFN_SYSCALL2(system_function, 43, int, char **);
 DEFN_SYSCALL1(open_serial, 44, int);
 DEFN_SYSCALL2(sleepabs,  45, unsigned long, unsigned long);
@@ -38,8 +36,6 @@ DEFN_SYSCALL2(stat, 49, char *, void *);
 DEFN_SYSCALL3(waitpid, 53, int, int *, int);
 DEFN_SYSCALL5(mount, SYS_MOUNT, char *, char *, char *, unsigned long, void *);
 DEFN_SYSCALL2(lstat, SYS_LSTAT, char *, void *);
-DEFN_SYSCALL2(fswait, SYS_FSWAIT, int, int *);
-DEFN_SYSCALL3(fswait2, SYS_FSWAIT2, int, int *,int);
 
 extern void _init();
 extern void _fini();

+ 11 - 0
libc/pty/pty.c

@@ -0,0 +1,11 @@
+#include <syscall.h>
+#include <syscall_nums.h>
+#include <sys/ioctl.h>
+#include <pty.h>
+#include <errno.h>
+
+DEFN_SYSCALL5(openpty, SYS_OPENPTY, int *, int *, char *, void *, void *);
+
+int openpty(int * amaster, int * aslave, char * name, const struct termios *termp, const struct winsize * winp) {
+	__sets_errno(syscall_openpty(amaster,aslave,name,(struct termios *)termp,(struct winsize *)winp));
+}

+ 10 - 0
libc/sched/sched_yield.c

@@ -0,0 +1,10 @@
+#include <syscall.h>
+#include <syscall_nums.h>
+#include <sched.h>
+#include <errno.h>
+
+DEFN_SYSCALL0(yield, SYS_YIELD);
+
+int sched_yield(void) {
+	__sets_errno(syscall_yield());
+}

+ 16 - 0
libc/sys/fswait.c

@@ -0,0 +1,16 @@
+#include <syscall.h>
+#include <syscall_nums.h>
+#include <sys/fswait.h>
+#include <errno.h>
+
+DEFN_SYSCALL2(fswait, SYS_FSWAIT, int, int *);
+DEFN_SYSCALL3(fswait2, SYS_FSWAIT2, int, int *,int);
+
+
+int fswait(int count, int * fds) {
+	__sets_errno(syscall_fswait(count, fds));
+}
+
+int fswait2(int count, int * fds, int timeout) {
+	__sets_errno(syscall_fswait2(count, fds, timeout));
+}