mirror of
https://github.com/cahirwpz/libnix.git
synced 2025-12-08 14:58:56 +00:00
Added headers for missing function prototypes.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
void __eprintf(const char *format,...) /* for asserts */
|
void __eprintf(const char *format,...) /* for asserts */
|
||||||
|
|||||||
@@ -1,37 +1,38 @@
|
|||||||
|
#include <proto/dos.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <proto/dos.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int readlink(const char *path, char *buf, int bufsiz) {
|
int readlink(const char *path, char *buf, int bufsiz)
|
||||||
struct DevProc *dp = NULL;
|
{
|
||||||
BPTR lock = NULL;
|
struct DevProc *dp = NULL;
|
||||||
int retval = -1;
|
BPTR lock = NULL;
|
||||||
|
int retval = -1;
|
||||||
|
|
||||||
lock = Open(path, MODE_OLDFILE);
|
lock = Open(path, MODE_OLDFILE);
|
||||||
if (lock == NULL) {
|
if (lock == NULL) {
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
dp = GetDeviceProc(path, NULL);
|
dp = GetDeviceProc(path, NULL);
|
||||||
if (dp == NULL) {
|
if (dp == NULL) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retval = ReadLink(dp->dvp_Port, lock, path, buf, bufsiz);
|
||||||
retval = ReadLink(dp->dvp_Port, lock, path, buf, bufsiz);
|
if (retval == TRUE)
|
||||||
if (retval == TRUE)
|
retval = strlen(buf);
|
||||||
retval = strlen(buf);
|
else
|
||||||
else
|
retval = -1;
|
||||||
retval = -1;
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (dp != NULL)
|
if (dp != NULL)
|
||||||
FreeDeviceProc(dp);
|
FreeDeviceProc(dp);
|
||||||
|
|
||||||
if (lock != NULL)
|
if (lock != NULL)
|
||||||
UnLock(lock);
|
UnLock(lock);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user