[Liboss-commit] CVS: liboss/lib esddsp.c,1.23,1.24
Brought to you by:
thesin
|
From: Alexander S. <mrv...@us...> - 2003-01-19 19:47:17
|
Update of /cvsroot/liboss/liboss/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv13519/lib
Modified Files:
esddsp.c
Log Message:
liboss doesn't crash anymore. successfully ran osscat. removed machine/byte_order.h because it was unnecessary.
Index: esddsp.c
===================================================================
RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- esddsp.c 11 Jan 2003 23:55:59 -0000 1.23
+++ esddsp.c 19 Jan 2003 19:47:14 -0000 1.24
@@ -39,7 +39,7 @@
#include <sys/stat.h>
#include <stdio.h>
#include <sys/errno.h>
-#ifdef HAVE_SYS_SYSCALL_H
+#ifdef HAVE_SYSCALLS
#include <sys/syscall.h>
#endif
@@ -48,7 +48,7 @@
#include <esd.h>
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
#define REAL_LIBC libSystem_handle
#endif
@@ -60,7 +60,7 @@
static char *ident = NULL, *mixer = NULL;
static int use_mixer = 1;
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
static void *libSystem_handle = NULL;
static int acquired_handle = 0;
#endif
@@ -80,12 +80,12 @@
{
static int (*func) (int,const void*,size_t) = NULL;
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
if (!func)
func = (int (*) (int)) dlsym (REAL_LIBC, "_write");
#endif
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
return (*func) (play,buf,sz);
#else
return syscall(SYS_write,play,buf,sz);
@@ -130,7 +130,7 @@
if (str)
{
- mixer = malloc (strlen (str) + strlen (ident) + 10);
+ mixer = malloc (strlen (str) + strlen (ident) + 20);
sprintf (mixer, "%s/.esddsp_%s", str, ident);
}
}
@@ -165,7 +165,7 @@
static void liboss_init(void)
{
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
if (!acquired_handle)
{
libSystem_handle = dlopen(SYSTEM_LIB,RTLD_LAZY);
@@ -182,7 +182,7 @@
mode_t mode;
liboss_init ();
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
if (!func)
func = (int (*) (const char *, int, mode_t)) dlsym (REAL_LIBC, "_open");
#endif
@@ -197,7 +197,11 @@
int ret;
flags |= O_NONBLOCK;
+#ifndef HAVE_SYSCALLS
if ((ret = (*func) (pathname, flags, mode)) >= 0)
+#else
+ if ((ret = syscall(SYS_open,pathname,flags,mode)) >= 0)
+#endif
return ret;
}
@@ -211,7 +215,7 @@
return (mixfd = (*func) (mixer, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR));
}
else
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
return (*func) (pathname, flags, mode);
#else
return syscall(SYS_open,pathname,flags,mode);
@@ -411,7 +415,7 @@
void *argp;
liboss_init ();
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
if (!func)
func = (int (*) (int, request_t, void *)) dlsym (REAL_LIBC, "_ioctl");
#endif
@@ -424,7 +428,7 @@
if(use_mixer)
return mixctl (fd, request, argp);
} else { /* (fd != sndfd && fd != mixfd) */
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
return (*func) (fd, request, argp);
#else
return syscall(SYS_ioctl,fd,request,argp);
@@ -437,7 +441,7 @@
liboss_close (int fd)
{
static int (*func) (int) = NULL;
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
if (!func)
func = (int (*) (int)) dlsym (REAL_LIBC, "_close");
#endif
@@ -445,7 +449,7 @@
sndfd = -1;
else if (fd == mixfd)
mixfd = -1;
-#ifndef HAVE_SYS_SYSCALL_H
+#ifndef HAVE_SYSCALLS
return (*func) (fd);
#else
return syscall(SYS_close,fd);
|