delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/04/27/20:36:48

Message-ID: <03b301c30d1e$3bd216f0$0600000a@broadpark.no>
From: "Gisle Vanem" <giva AT bgnett DOT no>
To: "djgpp workers" <djgpp-workers AT delorie DOT com>
Subject: /dev/full not full afterall
Date: Mon, 28 Apr 2003 02:36:39 +0200
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Reply-To: djgpp-workers AT delorie DOT com

I find that in latest 2.04 alpha1, writing to /dev/full doesn't fail with ENOSPC
as the info-page says. Example program:

----------------------------------------------------------

#include <stdio.h>
#include <sys/xdevices.h>
#include <fcntl.h>
#include <errno.h>

int main (void)
{
  const char *name = "/dev/full";
  FILE *fil;
  int   len;

  __install_dev_full();

  fil = fopen (name, "r+w");
  if (!fil)
  {
    perror ("fopen");
    return (-1);
  }

  errno = 0;
  len = fprintf (fil, "1234567890");
  if (len != 10)
     perror ("fprintf");

  printf ("%d bytes to %s, errno %d\n", len, name, errno);
  fclose (fil);
  return (0);
}

---------------------------------------------------------

I always get 10 bytes written and errno=0. 

Doesn't look like the problem is in fse_zero.c, but somewhere
higher up in the foodchain.
 
--gv

- Raw text -


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