www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/06/26/08:20:19

Message-Id: <s1d1d2d3.028@MAIL.TAIT.CO.NZ>
Date: Thu, 27 Jun 1996 00:16:28 +1200
From: Bill Currie <bill_currie AT MAIL DOT TAIT DOT CO DOT NZ>
To: djgpp-workers AT delorie DOT com
Cc: demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De
Subject: diffs for fcntl filesys extensions

These are the diffs (-c, two files) for adding fyle system extensions to fcntl().
 The only testing I've done is compilabiltiy (-Wall) as I have no application for
FS extensions right now (and so far, I have never used fcntl).

Bill

PS, after having another look at the sources, it's alot simpler than I thought (I
did't notice the '&' in the call to func(__FSEXT_fcntl, &rv, &handle) in the
functions I looked at (_read and _write I think)).  Nicely implemented and easy
to use.

-------------------------------- cut -fsext.h.diff-----------------
*** old\fsext.h	Sat Nov 25 23:39:06 1995
--- fsext.h	Thu Jun 27 00:01:00 1996
***************
*** 22,27 ****
--- 22,28 ----
    __FSEXT_write,
    __FSEXT_ready,
    __FSEXT_close,
+   __FSEXT_fcntl,
  } __FSEXT_Fnumber;
  
  /* _ready gets passed a fd and should return a mask of these,

-------------------------------- cut -fcntl.c.diff-----------------
*** old\fcntl.c	Sun Apr  2 03:57:20 1995
--- fcntl.c	Thu Jun 27 00:04:48 1996
***************
*** 2,11 ****
--- 2,21 ----
  #include <libc/stubs.h>
  #include <unistd.h>
  #include <fcntl.h>
+ #include <sys/fsext.h>
  
  int
  fcntl(int fd, int cmd, ...)
  {
+ 
+   __FSEXT_Function *func = __FSEXT_get_function(fd);
+   if (func)
+   {
+     int rv;
+     if (func(__FSEXT_fcntl, &rv, &fd))
+       return rv;
+   }
+ 
    switch (cmd)
    {
    case F_DUPFD:


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019