Sponsored Content
Top Forums Programming utime returning -1 BAD File DEscriptor Post 302491383 by Corona688 on Thursday 27th of January 2011 09:24:35 AM
Old 01-27-2011
Perhaps the message queue exists already, so O_CREAT causes it to refuse to create it again?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

bad file descriptor?

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

Utime Command

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

equivalent to utime

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

Script to search a bad record in a file then put the record in the bad file

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

Script to search a bad record in a file then put the record in the bad file

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

ufsdump from Solaris to ubuntu fails with bad file descriptor

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

Find command returning bad status--

would like to remove the post (8 Replies)
Discussion started by: vk39221
8 Replies

8. Shell Programming and Scripting

Error in the o/p says bad file descriptor...

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

Bad exchange descriptor : not able to remove files under zpool

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

Bad file descriptor - error with sed

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
mq_open(3)						     Library Functions Manual							mq_open(3)

NAME
mq_open - Establishes the connection between a message queue and a message queue descriptor (P1003.1b) LIBRARY
Realtime Library (librt.so, librt.a) SYNOPSIS
#include <mqueue.h> mqd_t mq_open ( const char *name, int oflag, ...); PARAMETERS
*name Specifies a pointer to the name of a string naming the message queue. The string can be a pathname. oflag Specifies the request for receive or send access to the message queue, as well as the blocking attributes of the resulting open descriptor for the calling process. This value of this argument is the bitwise inclusive OR of the values from the following list of flags. An application must specify exactly one of the first three flags: O_RDONLY Opens the message queue for receiving messages. This enables calls to the mq_receive function but not calls to the mq_send function for the calling process. Note that each process has its own read/write access to a queue. O_WRONLY Opens the queue for sending messages. This enables calls to the mq_send function but not calls to the mq_receive function for the calling process. O_RDWR Opens the queue for receiving and sending messages for the calling process. Any combination of the following flags is valid: O_CREAT Creates a message queue. Use of this flag requires specification of two additional arguments: mode, which is of type mode_t, and attr, which points to a mq_attr structure. If name has already been used to create a message queue that is still open, this flag has no effect, except as noted under O_EXCL. Otherwise, a message queue is created. The ID of the message queue becomes the effective user ID, and the group ID of the message queue becomes the effective group ID of the process. The mode argument sets the file permission bits. If the attr argument is NULL, the function creates the message queue with default attributes. If the attr argument is not NULL, and the calling process has appropriate privilege or per- mission, the message queue attributes are set as if the mq_setattr function were called with the attribute argument attr. If the attr argument is not NULL, but the calling process does not have the appropriate privilege or permission, the mq_open argument fails and returns an error. O_EXCL Prevents the opening of a message queue if O_CREAT is set and the message queue already exists. Use this flag only in com- bination with O_CREAT. O_NONBLOCK Allows calls to the mq_send and mq_receive functions to continue execution while waiting for resources or messages. When this flag is set and resources are not available, the mq_send and mq_receive functions fail and errno is set to EAGAIN. This flag is a per-open descriptor flag, and applies to the calling process only. Each process has its own blocking attributes for a queue. DESCRIPTION
The mq_open function establishes the connection between a message queue and a message queue descriptor. This function creates a new open message queue description that refers to a specified message queue and a message queue descriptor that refers to that open message queue description. The message queue descriptor is then available for use by other functions for reference to the message queue from the calling process. RETURN VALUES
On successful completion, this function returns a message queue descriptor. Otherwise, the function returns -1 and sets errno to indicate the error. ERRORS
The mq_open function fails under the following conditions: [EACCES] The message queue exists and the permissions specified by oflag are denied, or the message queue does not exist and permis- sion to create the message queue is denied. [EEXIST] O_CREAT and O_EXCL are set, and the named message queue already exists. [EFAULT] An internal virtual memory error occurred. [EINTR] The mq_open operation was interrupted by a signal. [EINVAL] The mq_open operation is not supported for the given name. O_CREAT was specified in oflag, the value of attr is not NULL, and either mq_maxmsg or mq_msgsize was less than or equal to zero. [EMFILE] Too many message queue descriptors or file descriptors are currently in use by this process. [ENAMETOOLONG] The length of the name string exceeds {PATH_MAX}, or a pathname component is longer than {NAME_MAX} while {_POSIX_NO_TRUNC} is in effect. [ENFILE] Too many message queues are currently open in the system. [ENOENT] O_CREAT is not set and the named message queue does not exist. [ENOSPC] There is insufficient space for the creation of the new message queue. RELATED INFORMATION
Functions: mq_close(3), mq_getattr(3), mq_receive(3), mq_send(3), mq_setattr(3), mq_unlink(3) Guide to Realtime Programming delim off mq_open(3)
All times are GMT -4. The time now is 02:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy