Sorry for the title because I didn't find a proper name for it. My question is about POSIX functions, such as timer_create(), mq_open() and pthread_create().
If I put the above function in main.c, there will have no problem. The queue is successfully created. But if I put in a file, let say foo.c. This file is compiled into libFOO.a and linked with main.c. Then I got the following error: errno(2: No such file or directory)
The other POSIX functions are also same if put in libFOO.a, for example, timer_create() failed with "Invalid argument" errro, pthread_create() succeeds but it is never run.
Is there any difference between running in main.c and foo.c? If you ever experienced such problem then please give me some hints
I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler
#!/bin/ksh
VAR='Oranges'
if
then
echo "Found Lemons"
elif
then
echo "Found Oranges"
fi
The output shouold clearly be "Found Oranges", but... (2 Replies)
Greetings To All!
I am running Solaris 10 in a sparc environment.
Here is the deal:
In /var/spool/cron/crontabs, there is a cron user named "sys". If I do a
crontab -l sys, it returns:
# 0 * * * 0-6 /usr/lib/sa/sa1
# 20,40 8-17 * * 1-5 /usr/lib/sa/sa1
# 5 18 * * 1-5 /usr/lib/sa/sa2... (8 Replies)
Hi, i have this code... in order to test my problem...
#include <stdio.h>
#include <iostream>
#include <pthread.h>
static void* cliente(void *datos);
int main()
{
pthread_attr_t tattr;
int ret;
size_t size = PTHREAD_STACK_MIN + 0x0100;
ret =... (8 Replies)
Hi All,
Appreciate if anyone can help. I've a script where it does echo function like this
while
do
FILE_ARG="cu0${w}_${FILE}_${DT}.av"
ORACLE_ERROR=`grep "ORA-" ${FILE_ARG}`
if ]; then
Func_Log_Writer "Fail! ${FILE_ARG}\n"
Func_Log_Writer "Error message:... (2 Replies)
Hi,
I've Ubuntu 8.04, and it has some files that I just cannot delete. I've tried everything, inode, fsck etc.
Here is what the ls -li outputs
root@ubuntu:/home/luser/.local/share/Trash/files/junk# ls -l
ls: cannot access TRUNK_: No such file or directory
ls: cannot access 2006_output.mv:... (11 Replies)
Hi,
I want to install net-snmp-devel package but i have following dependecy problem.
It's very odd, i don't get it. One of packages is depended on the other one, the other one is depended on the previous one as well. :S :S
Could you help me please?
Here are the steps:
# ls -l
total... (4 Replies)
My script-
result=""
times()
{
echo "inside the times function"
result=8
echo "Inside function $result"
return $result
}
result=$(times)
echo "the value is "$?
echo "the value of result $result"
when I run I get this, why the value still remain 0.
$ ./func
the value is 0
the value... (5 Replies)
I wonder if someone knows what is the rationale behind linking function calls of the POSIX threads library at link-time vs. run-time.
For example, if I create the following program:
#include <pthread.h>
void noop() {
return;
}
int main() {
pthread_self();
pthread_atfork(noop,... (1 Reply)
Hi,
I have a simple awk script:
BEGIN{}
{
$a=$2-$1;
print $a
}
END{if(NR==0){
print "0"
}
}
to which I provide the following input
2.9 14
22.2 27 (4 Replies)
Discussion started by: jamie_123
4 Replies
LEARN ABOUT NETBSD
pthread_create
PTHREAD_CREATE(3) BSD Library Functions Manual PTHREAD_CREATE(3)NAME
pthread_create -- create a new thread
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
int
pthread_create(pthread_t * restrict thread, const pthread_attr_t * restrict attr, void *(*start_routine)(void *), void * restrict arg);
DESCRIPTION
The pthread_create() function is used to create a new thread, with attributes specified by attr, within a process. If attr is NULL, the
default attributes are used.
The attributes specified via attr are copied into the new thread. Any subsequent modifications to the attributes object attr points to will
have no effect upon already-created threads. It is thus also safe to pass the same attr to multiple calls to pthread_create().
Upon successful completion pthread_create() will store the ID of the created thread in the location specified by thread. The thread is cre-
ated executing start_routine with arg as its sole argument.
If the start_routine returns, the effect is as if there was an implicit call to pthread_exit() using the return value of start_routine as the
exit status. Note that the thread in which main() was originally invoked differs from this. When it returns from main(), the effect is as
if there was an implicit call to exit() using the return value of main() as the exit status.
The signal state of the new thread is initialized as:
o The signal mask is inherited from the creating thread.
o The set of signals pending for the new thread is empty.
RETURN VALUES
If successful, the pthread_create() function will return zero. Otherwise an error number will be returned to indicate the error.
ERRORS
pthread_create() shall fail if:
[EAGAIN] The system lacks the necessary resources to create another thread, or the system-imposed limit on the total number of
threads in a process PTHREAD_THREADS_MAX would be exceeded.
[EINVAL] The value specified by attr is invalid.
SEE ALSO fork(2), pthread_attr(3), pthread_cleanup_pop(3), pthread_cleanup_push(3), pthread_exit(3), pthread_join(3)STANDARDS
The function conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
BSD July 9, 2010 BSD