Home > Archive > Unix Programming > May 2007 > Re: What's the purpose of these unused Macros?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: What's the purpose of these unused Macros?
|
|
| K-mart Cashier 2007-05-22, 7:06 pm |
| On May 21, 6:52 pm, K-mart Cashier <cdal...@gmail.com> wrote:
> On May 21, 6:32 pm, Eric Sosman <esos...@acm-dot-org.invalid> wrote:
>
>
>
>
>
>
>
>
>
> Here is what is copied and pasted from my terminal
>
> #ifdef LOCK_LOCKF
> #ifdef HAVE_SYS_FILE_H
> #include <sys/lockf.h>
> #endif
> #ifdef HAVE_SYS_FILE_H
> #include <sys/file.h>
> #endif
> #define LOCK(file) fs (file, 0L, 0), lockf(file, 1, 0L)
> #define UNLOCK(file) fs (file, 0L, 0), lockf(file, 0, 0L)
> #endif /* LOCK_LOCKF */
>
> #ifdef LOCK_LOCKING
> #ifdef HAVE_SYS_LOCKING_H
> #include <sys/locking.h>
> #endif
> #define LOCK(file) fs (file, 0L, 0), chk_lock(file, 1)
> #define UNLOCK(file) fs (file, 0L, 0), chk_lock(file, 0)
> #endif /* LOCK_LOCKING */
>
> #ifdef LOCK_NONE
> #define LOCK(file)
> #define UNLOCK(file)
> #endif /* LOCK_NONE */
>
> #ifdef SUID
> #define CHN_MODE 0644
> #define DEP_MODE 0600
> #define USR_MODE 0600
>
One last question. Are the macro names like LOCK_LOCKF and
LOCK_LOCKING random names? Ie, could the author have say used LOCK and
LOCKING?
| |
| Barry Margolin 2007-05-23, 4:23 am |
| In article <1179841749.619870.259460@z28g2000prd.googlegroups.com>,
K-mart Cashier <cdalten@gmail.com> wrote:
> One last question. Are the macro names like LOCK_LOCKF and
> LOCK_LOCKING random names? Ie, could the author have say used LOCK and
> LOCKING?
They're arbitrary. Mainly he has to ensure that his macros don't
conflict with the names used in any of the other headers used.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
| |
|
|
|
|
|