01-28-2011
@Corona688: I also got the same doubt, so I tried removing O_CREATE with O_EXCL; but that also dint work
@DGPickett: Sorry I dint get you fully. Can you please elaborate a little more?
Once Again Thanks All
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Ok, I'm sure this is a total newbie question, but I think I'm in the right place, no?
I'm trying to call a perl module from a cgi script - Mail::Sendmail - and my web host installed the module in a directory that doesn't seem to be accessible, at least not the way I'm trying. But I thought you... (1 Reply)
Discussion started by: ftb
1 Replies
2. Shell Programming and Scripting
Hello !
Do you have any example of the utime command ?
I'm trying to change the time of last change of a file to a defined time.
Thanks. (3 Replies)
Discussion started by: margue
3 Replies
3. Programming
Hi,
Is there any system call which changes the time of symbolic link apart from utime? or if tere is no system call any other option of how to do it?
Thanks (4 Replies)
Discussion started by: naan
4 Replies
4. UNIX for Advanced & Expert Users
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (1 Reply)
Discussion started by: shilendrajadon
1 Replies
5. Shell Programming and Scripting
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (2 Replies)
Discussion started by: shilendrajadon
2 Replies
6. Ubuntu
Hi All
I have a dedicated backup server running ubuntu 10.04, which has recently been rebuilt (same OS, just different h/w)
This is used to receive ufsdump output from a number of Solaris servers, using the following syntax:
ufsdump 1uf :/path/to/backup/file /fs/to/be/backed/up
This has... (1 Reply)
Discussion started by: in2deep
1 Replies
7. UNIX for Dummies Questions & Answers
would like to remove the post (8 Replies)
Discussion started by: vk39221
8 Replies
8. Shell Programming and Scripting
grt=`sort -nr line_count.txt|head -1`
while read $dline
do
if $grt" -eq "`wc -l combo_operncount.$dline|awk '{print $1}'`" ]
then
awk -F, '{print $1}' combo_operncount.$dline > FULLD7
else
echo combo_operncount.$dline >> filecoll.txt
fname=`cat filecoll.txt|tr -s "\n" " "`
echo $fname... (6 Replies)
Discussion started by: nikhil jain
6 Replies
9. Solaris
Hi ,
One of my zone went down and when i booted it up i could see the pool in degraded state with some check sum errors . we have brought the pool online after scrubbing. But few files are showing this error
Bad exchange descriptor
Please let me know how to remove these files (2 Replies)
Discussion started by: chidori
2 Replies
10. UNIX for Beginners Questions & Answers
I'm learning SED command. And while doing that i got to this place where i'm taking a copy of my existing file. The code i used is -
sed -n '/Storm/ w Storm.txt' books.txt
As expected, the file 'books.txt' is read , and lines with 'Storm' is put in to the new file 'Storm.txt'. However, it also... (4 Replies)
Discussion started by: justo
4 Replies
LEARN ABOUT MOJAVE
sem_open
SEM_OPEN(2) BSD System Calls Manual SEM_OPEN(2)
NAME
sem_open -- initialize and open a named semaphore
SYNOPSIS
#include <semaphore.h>
sem_t *
sem_open(const char *name, int oflag, ...);
The parameters "mode_t mode" and "unsigned int value" are optional.
DESCRIPTION
The named semaphore named name is initialized and opened as specified by the argument oflag and a semaphore descriptor is returned to the
calling process.
The value of oflag is formed by or'ing the following values:
O_CREAT create the semaphore if it does not exist
O_EXCL error if create and semaphore exists
If O_CREAT is specified, sem_open() requires an additional two arguments. mode specifies the permissions for the semaphore as described in
chmod(2) and modified by the process' umask value (see umask(2)). The semaphore is created with an initial value, which must be less than or
equal to SEM_VALUE_MAX.
If O_EXCL is specified and the semaphore exists, sem_open() fails. The check for the existence of the semaphore and the creation of the sem-
aphore are atomic with respect to all processes calling sem_open() with O_CREAT and O_EXCL set.
When a new semaphore is created, it is given the user ID and group ID which correspond to the effective user and group IDs of the calling
process. There is no visible entry in the file system for the created object in this implementation.
The returned semaphore descriptor is available to the calling process until it is closed with sem_close(), or until the caller exits or
execs.
If a process makes repeated calls to sem_open(), with the same name argument, the same descriptor is returned for each successful call,
unless sem_unlink() has been called on the semaphore in the interim.
If sem_open() fails for any reason, it will return a value of SEM_FAILED and sets errno. On success, it returns a semaphore descriptor.
ERRORS
The named semaphore is opened unless:
[EACCES] The required permissions (for reading and/or writing) are denied for the given flags; or O_CREAT is specified, the object
does not exist, and permission to create the semaphore is denied.
[EEXIST] O_CREAT and O_EXCL were specified and the semaphore exists.
[EINTR] The sem_open() operation was interrupted by a signal.
[EINVAL] The shm_open() operation is not supported; or O_CREAT is specified and value exceeds SEM_VALUE_MAX.
[EMFILE] The process has already reached its limit for semaphores or file descriptors in use.
[ENAMETOOLONG] name exceeded PSEMNAMLEN characters.
[ENFILE] Too many semaphores or file descriptors are open on the system.
[ENOENT] O_CREAT is not set and the named semaphore does not exist.
[ENOSPC] O_CREAT is specified, the file does not exist, and there is insufficient space available to create the semaphore.
SEE ALSO
sem_close(2), sem_post(2), sem_trywait(2), sem_unlink(2), sem_wait(2), semctl(2), semget(2), semop(2), umask(2)
HISTORY
sem_open() is specified in the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995).
Darwin June 8, 2000 Darwin