unix: stub file watcher implementation
The file watcher API has not been implemented on all Unices yet. Provide stubs on those platforms so libuv at least compiles.
This commit is contained in:
parent
019e6edf47
commit
3368d6c1a2
@ -46,6 +46,11 @@ typedef struct {
|
|||||||
|
|
||||||
typedef int uv_file;
|
typedef int uv_file;
|
||||||
|
|
||||||
|
/* Stub. Remove it once all platforms support the file watcher API. */
|
||||||
|
#ifndef UV_FS_EVENT_PRIVATE_FIELDS
|
||||||
|
#define UV_FS_EVENT_PRIVATE_FIELDS /* empty */
|
||||||
|
#endif
|
||||||
|
|
||||||
#define UV_LOOP_PRIVATE_FIELDS \
|
#define UV_LOOP_PRIVATE_FIELDS \
|
||||||
ares_channel channel; \
|
ares_channel channel; \
|
||||||
/* \
|
/* \
|
||||||
|
|||||||
@ -20,8 +20,10 @@
|
|||||||
|
|
||||||
#include "uv.h"
|
#include "uv.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#undef NANOSEC
|
#undef NANOSEC
|
||||||
@ -50,3 +52,17 @@ int uv_exepath(char* buffer, size_t* size) {
|
|||||||
buffer[*size] = '\0';
|
buffer[*size] = '\0';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int uv_fs_event_init(uv_loop_t* loop,
|
||||||
|
uv_fs_event_t* handle,
|
||||||
|
const char* filename,
|
||||||
|
uv_fs_event_cb cb) {
|
||||||
|
uv_err_new(loop, ENOSYS);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void uv__fs_event_destroy(uv_fs_event_t* handle) {
|
||||||
|
assert(0 && "implement me");
|
||||||
|
}
|
||||||
|
|||||||
@ -20,7 +20,10 @@
|
|||||||
|
|
||||||
#include "uv.h"
|
#include "uv.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#include <mach/mach_time.h>
|
#include <mach/mach_time.h>
|
||||||
@ -63,3 +66,17 @@ int uv_exepath(char* buffer, size_t* size) {
|
|||||||
*size = strlen(buffer);
|
*size = strlen(buffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int uv_fs_event_init(uv_loop_t* loop,
|
||||||
|
uv_fs_event_t* handle,
|
||||||
|
const char* filename,
|
||||||
|
uv_fs_event_cb cb) {
|
||||||
|
uv_err_new(loop, ENOSYS);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void uv__fs_event_destroy(uv_fs_event_t* handle) {
|
||||||
|
assert(0 && "implement me");
|
||||||
|
}
|
||||||
|
|||||||
@ -20,15 +20,18 @@
|
|||||||
|
|
||||||
#include "uv.h"
|
#include "uv.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#undef NANOSEC
|
#undef NANOSEC
|
||||||
#define NANOSEC 1000000000
|
#define NANOSEC 1000000000
|
||||||
|
|
||||||
|
|
||||||
uint64_t uv_hrtime(void) {
|
uint64_t uv_hrtime(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
@ -63,3 +66,17 @@ int uv_exepath(char* buffer, size_t* size) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int uv_fs_event_init(uv_loop_t* loop,
|
||||||
|
uv_fs_event_t* handle,
|
||||||
|
const char* filename,
|
||||||
|
uv_fs_event_cb cb) {
|
||||||
|
uv_err_new(loop, ENOSYS);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void uv__fs_event_destroy(uv_fs_event_t* handle) {
|
||||||
|
assert(0 && "implement me");
|
||||||
|
}
|
||||||
|
|||||||
@ -20,17 +20,20 @@
|
|||||||
|
|
||||||
#include "uv.h"
|
#include "uv.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#undef NANOSEC
|
#undef NANOSEC
|
||||||
#define NANOSEC 1000000000
|
#define NANOSEC 1000000000
|
||||||
|
|
||||||
|
|
||||||
uint64_t uv_hrtime(void) {
|
uint64_t uv_hrtime(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
@ -66,3 +69,17 @@ int uv_exepath(char* buffer, size_t* size) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int uv_fs_event_init(uv_loop_t* loop,
|
||||||
|
uv_fs_event_t* handle,
|
||||||
|
const char* filename,
|
||||||
|
uv_fs_event_cb cb) {
|
||||||
|
uv_err_new(loop, ENOSYS);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void uv__fs_event_destroy(uv_fs_event_t* handle) {
|
||||||
|
assert(0 && "implement me");
|
||||||
|
}
|
||||||
|
|||||||
@ -22,8 +22,11 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <unistd.h>
|
#include <assert.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
uint64_t uv_hrtime() {
|
uint64_t uv_hrtime() {
|
||||||
@ -58,3 +61,17 @@ int uv_exepath(char* buffer, size_t* size) {
|
|||||||
*size = res;
|
*size = res;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int uv_fs_event_init(uv_loop_t* loop,
|
||||||
|
uv_fs_event_t* handle,
|
||||||
|
const char* filename,
|
||||||
|
uv_fs_event_cb cb) {
|
||||||
|
uv_err_new(loop, ENOSYS);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void uv__fs_event_destroy(uv_fs_event_t* handle) {
|
||||||
|
assert(0 && "implement me");
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user