delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/06/26/09:41:00

From: "Tom Demmer" <DEMMER AT brain1 DOT lstm DOT ruhr-uni-bochum DOT de>
Organization: Lehrstuhl Stroemungsmechanik, RUB
To: djgpp-workers AT delorie DOT com
Date: Wed, 26 Jun 1996 15:34:20 GMT-1
Subject: diffs for fcntl filesys extensions
Reply-to: Demmer AT LStM DOT Ruhr-Uni-Bochum DOT De
Message-ID: <C5E30E3337@brain1.lstm.ruhr-uni-bochum.de>

This are not yet the changes for open()/_open, they will follow soon
(I hope so...)

------- Forwarded Message Follows -------

Date sent:      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
Copies to:      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:
--------------------------------------

Ciao


Tom

  ******************************************************************
  *  Thomas Demmer                     * Phone : +49 234 700 6434  *
  *  Universitaetsstr. 150             * or you try                *
  *  Lehrstuhl fuer Stroemungsmechanik *         +49 234 700 2896  *
  *  D-44780 Bochum                    * and MIGHT get someone who *
  *                                    * knows where I am          *
  *  Demmer AT LStM DOT Ruhr-Uni-Bochum DOT De    * Fax    : +49 234 709-4162 *
  *          http://www.lstm.ruhr-uni-bochum.de/~demmer            *
  ******************************************************************

    Who needs BRAINS when you have software?
                             -- Marvin

- Raw text -


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