www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/07/20/16:59:26

From: Eric Backus <ericb AT lsid DOT hp DOT com>
Subject: Re: waitpid, S_ISREG
To: bergman AT panix DOT com
Date: Tue, 20 Jul 93 13:27:46 PDT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Mailer: Elm [revision: 66.25]

> I'm trying to port the "woman" (enhanced "man") program
> recently posted to comp.sources.unix, and I'm running into
> two problems. There are references in the code to a waitpid
> function and S_ISREG macro/defined value.

> I'm currently using v. 1.09. Are these functions defined in
> 1.10?

The definition of S_ISREG should be in <sys/stat.h> and should be:

#define S_ISREG(x)	(((x) & S_IFMT) == S_IFREG)

I don't know if this is in 1.10.  I suppose it should be.  There are
similar macros for other file types:

#define S_ISDIR(x)	(((x) & S_IFMT) == S_IFDIR)
#define S_ISCHR(x)	(((x) & S_IFMT) == S_IFCHR)
#define S_ISBLK(x)	(((x) & S_IFMT) == S_IFBLK)
#define S_ISFIFO(x)	(((x) & S_IFMT) == S_IFIFO)
--
				Eric Backus
				ericb AT lsid DOT hp DOT com
				(206) 335-2495

- Raw text -


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