552 static char* native_path(char *path);
553 static int ftruncate(int fd, jlong length);
554 static int fsync(int fd);
555 static int available(int fd, jlong *bytes);
556 static int get_fileno(FILE* fp);
557 static void flockfile(FILE* fp);
558 static void funlockfile(FILE* fp);
559
560 static int compare_file_modified_times(const char* file1, const char* file2);
561
562 //File i/o operations
563
564 static size_t read(int fd, void *buf, unsigned int nBytes);
565 static size_t read_at(int fd, void *buf, unsigned int nBytes, jlong offset);
566 static size_t restartable_read(int fd, void *buf, unsigned int nBytes);
567 static size_t write(int fd, const void *buf, unsigned int nBytes);
568
569 // Reading directories.
570 static DIR* opendir(const char* dirname);
571 static int readdir_buf_size(const char *path);
572 static struct dirent* readdir(DIR* dirp, dirent* dbuf);
573 static int closedir(DIR* dirp);
574
575 // Dynamic library extension
576 static const char* dll_file_extension();
577
578 static const char* get_temp_directory();
579 static const char* get_current_directory(char *buf, size_t buflen);
580
581 // Builds the platform-specific name of a library.
582 // Returns false if the buffer is too small.
583 static bool dll_build_name(char* buffer, size_t size,
584 const char* fname);
585
586 // Builds a platform-specific full library path given an ld path and
587 // unadorned library name. Returns true if the buffer contains a full
588 // path to an existing file, false otherwise. If pathname is empty,
589 // uses the path to the current directory.
590 static bool dll_locate_lib(char* buffer, size_t size,
591 const char* pathname, const char* fname);
592
|
552 static char* native_path(char *path);
553 static int ftruncate(int fd, jlong length);
554 static int fsync(int fd);
555 static int available(int fd, jlong *bytes);
556 static int get_fileno(FILE* fp);
557 static void flockfile(FILE* fp);
558 static void funlockfile(FILE* fp);
559
560 static int compare_file_modified_times(const char* file1, const char* file2);
561
562 //File i/o operations
563
564 static size_t read(int fd, void *buf, unsigned int nBytes);
565 static size_t read_at(int fd, void *buf, unsigned int nBytes, jlong offset);
566 static size_t restartable_read(int fd, void *buf, unsigned int nBytes);
567 static size_t write(int fd, const void *buf, unsigned int nBytes);
568
569 // Reading directories.
570 static DIR* opendir(const char* dirname);
571 static int readdir_buf_size(const char *path);
572 static struct dirent* readdir(DIR* dirp);
573 static int closedir(DIR* dirp);
574
575 // Dynamic library extension
576 static const char* dll_file_extension();
577
578 static const char* get_temp_directory();
579 static const char* get_current_directory(char *buf, size_t buflen);
580
581 // Builds the platform-specific name of a library.
582 // Returns false if the buffer is too small.
583 static bool dll_build_name(char* buffer, size_t size,
584 const char* fname);
585
586 // Builds a platform-specific full library path given an ld path and
587 // unadorned library name. Returns true if the buffer contains a full
588 // path to an existing file, false otherwise. If pathname is empty,
589 // uses the path to the current directory.
590 static bool dll_locate_lib(char* buffer, size_t size,
591 const char* pathname, const char* fname);
592
|