undelete: implement a stub for getdents() on macOS
This commit is contained in:
parent
54ad11673c
commit
5cb8c75f8c
|
@ -31,7 +31,9 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <System.h>
|
#include <System.h>
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
#ifdef __linux__
|
#if defined(__APPLE__)
|
||||||
|
# include <errno.h>
|
||||||
|
#elif defined(__linux__)
|
||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# include <errno.h>
|
# include <errno.h>
|
||||||
|
@ -89,7 +91,7 @@ static GtkWidget * _undelete_get_widget(Undelete * undelete);
|
||||||
static void _undelete_refresh(Undelete * undelete, GList * selection);
|
static void _undelete_refresh(Undelete * undelete, GList * selection);
|
||||||
|
|
||||||
/* useful */
|
/* useful */
|
||||||
#ifdef __linux__
|
#if defined(__APPLE__) || defined(__linux__)
|
||||||
static int getdents(int fd, char * buf, unsigned int count);
|
static int getdents(int fd, char * buf, unsigned int count);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -191,7 +193,13 @@ static void _undelete_refresh(Undelete * undelete, GList * selection)
|
||||||
|
|
||||||
|
|
||||||
/* useful */
|
/* useful */
|
||||||
#ifdef __linux__
|
#if defined(__APPLE__)
|
||||||
|
static int getdents(int fd, char * buf, unsigned int count)
|
||||||
|
{
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#elif defined(__linux__)
|
||||||
static int getdents(int fd, char * buf, unsigned int count)
|
static int getdents(int fd, char * buf, unsigned int count)
|
||||||
{
|
{
|
||||||
return syscall(__NR_getdents64, fd, buf, count);
|
return syscall(__NR_getdents64, fd, buf, count);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user