From 701635b319c0153cf68896d34cb74b2906e02407 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 29 Aug 2001 09:36:45 +0000 Subject: better floppy detection/info --- perl-install/c/stuff.xs.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'perl-install/c/stuff.xs.pm') diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index f6e63a85d..563c97013 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -26,6 +26,7 @@ print ' #include #include #include +#include #include #include #include @@ -236,6 +237,20 @@ isDvdDrive(fd) OUTPUT: RETVAL +char * +floppy_info(name) + char * name + CODE: + int fd = open(name, O_RDONLY | O_NONBLOCK); + RETVAL = NULL; + if (fd != -1) { + char drivtyp[17]; + ioctl(fd, FDGETDRVTYP, (void *)drivtyp); + RETVAL = drivtyp; + } + OUTPUT: + RETVAL + unsigned int total_sectors(fd) int fd -- cgit v1.2.1