Lines Matching refs:nvram_fd
94 static int nvram_fd = -1;
101 if (nvram_fd >= 0)
104 if ((nvram_fd = open(PATH_DEV_NVRAM, O_RDWR)) < 0)
108 nvram_buf = mmap(NULL, MAX_NVRAM_SPACE, PROT_READ, MAP_SHARED, nvram_fd, 0);
110 close(nvram_fd);
111 nvram_fd = -1;
115 (void)fcntl(nvram_fd, F_SETFD, FD_CLOEXEC);
142 count = read(nvram_fd, off, count);
206 if (nvram_fd < 0)
216 ret = read(nvram_fd, buf, count);
248 ret = write(nvram_fd, buf, count);
289 ret = ioctl(nvram_fd, NVRAM_MAGIC, NULL);