elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
elkscmd
/
minix2
/
eject.c
File editor
/* eject 1.3 - Eject removable media Author: Kees J. Bot * 11 Dec 1993 */ #define nil 0 #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <sys/ioctl.h> void fatal(char *label) { fprintf(stderr, "eject: %s: %s\n", label, strerror(errno)); exit(1); } void main(int argc, char **argv) { char *device; int fd; if (argc != 2) { fprintf(stderr, "Usage: eject <device>\n"); exit(1); } device= argv[1]; /* Try to open it in whatever mode. */ fd= open(device, O_RDONLY); if (fd < 0 && errno == EACCES) fd= open(device, O_WRONLY); if (fd < 0) fatal(device); /* Tell it to eject. */ if (ioctl(fd, DIOCEJECT, nil) < 0) fatal(device); exit(0); }
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history