Skip site navigation (1)Skip section navigation (2)
Date:      17 Jan 2002 14:02:48 -0800
From:      swear@blarg.net (Gary W. Swearingen)
To:        "Mike Meyer" <mwm-dated-1011665424.930a9d@mired.org>
Cc:        questions@FreeBSD.ORG
Subject:   Re: HOWTO -- backup onto CDRs?
Message-ID:  <zcn0zcskjb.0zc@localhost.localdomain>
In-Reply-To: <15430.12944.372926.781882@guru.mired.org>
References:  <15430.12944.372926.781882@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
"Mike Meyer" <mwm-dated-1011665424.930a9d@mired.org> writes:

> Gary W. Swearingen <swear@blarg.net> types:
> > Looks like /usr/include/sys/stat.h has the definitive list and it adds
> > something called a "whiteout".  Never heard of it; maybe it's not
> > supported by other code, or just used by the system software.  (The
> > "find" man page agrees with perl.)
> 
> They get mentioned in the rm and mknod(2) man pages. Find actually
> knows about them - it's "-type w", even though it's not documented.

Oooo.  Thank you very much for that.  Not that I care much about
whiteouts, but the whiteout mention in mknod(2) explains why "afio"
has a bug.  It's trying to use mknod(2) to create a socket and that's
said there to not be supported.  (Don't ask me why it even archives
sockets (and FIFOs/pipes); I haven't a clue.)

Anybody care to fix this (from afio-2.4.7 afio.c) to create a socket
file (where asb->sb_mode has bits set for socket file type):

    fd = 0;
    if (exists)
        if (perm != operm && chmod (name, perm) < 0)
            return (warn (name, syserr ()));
        else { ; }
    else if (mknod (name, asb->sb_mode, (dev_t) 0) < 0
        && (errno != ENOENT
                  || dirneed (name) < 0
                  || mknod (name, asb->sb_mode, (dev_t) 0) < 0))
    return (warn (name, syserr ()));

Or just name the functions for creating a socket file or a function
which has code similar to the above but for sockets.  I'm not a C coder.

(That "dirneed" creates missing directories.)

I'm not sure if I'll code and test a fix or just pass it on to the
port or source maintainer (who doesn't do FreeBSD).

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?zcn0zcskjb.0zc>