Lines Matching defs:fd

2295   int fd = ::open(filename, O_RDONLY);
2296 if (fd == -1) {
2302 while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
2306 ::close(fd);
2876 int fd = ::open(buf, O_CREAT | O_RDWR, S_IRWXU);
2878 if (fd != -1) {
2879 off_t rv = ::lseek(fd, size-2, SEEK_SET);
2881 if (::write(fd, "", 1) == 1) {
2884 MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE, fd, 0);
2887 ::close(fd);
3591 size_t os::read(int fd, void *buf, unsigned int nBytes) {
3592 RESTARTABLE_RETURN_INT(::read(fd, buf, nBytes));
5113 int fd;
5117 fd = ::open(path, oflag, mode);
5118 if (fd == -1) return -1;
5123 int ret = ::fstat(fd, &buf);
5129 ::close(fd);
5133 ::close(fd);
5162 int flags = ::fcntl(fd, F_GETFD);
5164 ::fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
5171 return fd;
5185 jlong os::current_file_offset(int fd) {
5186 return (jlong)::lseek(fd, (off_t)0, SEEK_CUR);
5190 jlong os::seek_to_file_offset(int fd, jlong offset) {
5191 return (jlong)::lseek(fd, (off_t)offset, SEEK_SET);
5197 int os::available(int fd, jlong *bytes) {
5202 if (::fstat(fd, &buf) >= 0) {
5211 if (::ioctl(fd, FIONREAD, &n) >= 0) {
5217 if ((cur = ::lseek(fd, 0L, SEEK_CUR)) == -1) {
5219 } else if ((end = ::lseek(fd, 0L, SEEK_END)) == -1) {
5221 } else if (::lseek(fd, cur, SEEK_SET) == -1) {
5228 int os::socket_available(int fd, jint *pbytes) {
5229 if (fd < 0)
5234 RESTARTABLE(::ioctl(fd, FIONREAD, pbytes), ret);
5243 char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
5266 fd, file_offset);
5275 char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
5279 return os::map_memory(fd, file_name, file_offset, addr, bytes, read_only,
5506 int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
5507 if (fd != -1) {
5509 ::close(fd);