Sponsored Content
Top Forums UNIX for Advanced & Expert Users Pthread attr setting doesn't work before thread create? Post 302523020 by DGPickett on Tuesday 17th of May 2011 01:26:34 PM
Old 05-17-2011
Perhaps your thread lacked PTHREAD_SCOPE_SYSTEM, i.e., was not a lwp, so the lwp and its scheduling nice-ness is that of the parent.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why doesn't this work?

cat .servers | while read LINE; do ssh jason@$LINE $1 done exit 1 ./command.ksh "ls -l ~jason" Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing? Thanks! JP (2 Replies)
Discussion started by: jpeery
2 Replies

2. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

3. Shell Programming and Scripting

ls -d doesn't work on Solaris

Hello, the ls -d command to only list directories in a directory doesn't seem to work on Solaris and the man command says to use that combination: ls -d Anyone have the same problem and find a resolve? Thanks BobK (9 Replies)
Discussion started by: bobk544
9 Replies

4. UNIX for Advanced & Expert Users

remsh doesn't work

Hi, I need to use remsh inside a ksh script. The script would remsh to another machine (maybe different OS) and then execute commands. A Simple Script: #!/usr/bin/ksh remsh sun7656 -l myuser "cd /user.3/MyFolder; ls -lart" But this gives me the error: permission denied I also... (4 Replies)
Discussion started by: som.nitk
4 Replies

5. Shell Programming and Scripting

Help with script.. it Just doesn't work

Hello,, Im verry new to scripting and have some problems with this script i made.. What it does: It checks a directory for a new directory and then issues a couple of commands. checks sfv - not doing right now checks rar - it checks if theres a rar file and when there is it skips to... (1 Reply)
Discussion started by: atmosroll
1 Replies

6. Shell Programming and Scripting

echo doesn't work right

Hi,when I run my first shell script,I got something that doesn't work right. I wrote this code in the script. echo -e "Hello,World\a\n"But the screen print like this: -e Hello,World The "-e" wasn't supposed to be printed out. Can anyone help me out?:wall: Many thanks!:) (25 Replies)
Discussion started by: Demon
25 Replies

7. UNIX for Dummies Questions & Answers

Why doesn't this work?

find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \; Returns this failure: mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies

8. Shell Programming and Scripting

-ne 0 doesn't work -le does

Hi, I am using korn shell. until ] do echo "\$# = " $# echo "$1" shift done To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work. Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies

9. Shell Programming and Scripting

Timeout doesn't work, please help me

#!/bin/sh trap "cleanup" TERM timeout=5 mainpid=$$ cleanup() { echo "at $i interupt" kill -9 0 } watchdog() { sleep $1 } (watchdog $timeout && kill -TERM $mainpid) & run_test() (10 Replies)
Discussion started by: yanglei_fage
10 Replies

10. Post Here to Contact Site Administrators and Moderators

Thread / post doesn't open

Dear colleagues, this post doesn't open; error message: Anything we / I can do? Rgds Rüdiger (0 Replies)
Discussion started by: RudiC
0 Replies
getpriority(3C) 					   Standard C Library Functions 					   getpriority(3C)

NAME
getpriority, setpriority - get and set the nice value SYNOPSIS
#include <sys/resource.h> int getpriority(int which, id_t who); int setpriority(int which, id_t who, int value); DESCRIPTION
The getpriority() function obtains the nice value of a process, thread, or set of processes. The setpriority() function sets the nice value of a process, thread, or set of processes to value+NZERO, where NZERO is defined to be 20. Target entities are specified by the values of the which and who arguments. The which argument can be one of the following values: PRIO_PROCESS, PRIO_PGRP, PRIO_USER, PRIO_GROUP, PRIO_SESSION, PRIO_LWP, PRIO_TASK, PRIO_PROJECT, PRIO_ZONE, or PRIO_CONTRACT, indicating that the who argument is to be interpreted as a process ID, a process group ID, an effective user ID, an effective group ID, a session ID, a thread (lwp) ID, a task ID, a project ID, a zone ID, or a process contract ID, respectively. A 0 value for the who argument specifies the current process, process group, or user. A 0 value for the who argument is treated as valid group ID, session ID, thread (lwp) ID, task ID, project ID, zone ID, or process contract ID. A P_MYID value for the who argument can be used to specify the current group, session, thread, task, project, zone, or process contract, respectively. If a specified process is multi-threaded, the nice value set with setpriority() affects all threads in the process. If more than one process is specified, getpriority() returns NZERO less than the lowest nice value pertaining to any of the specified enti- ties, and setpriority() sets the nice values of all of the specified processes to value+NZERO. The default nice value is NZERO. Lower nice values cause more favorable scheduling. The range of valid nice values is 0 to NZERO*2-1. If value+NZERO is less than the system's lowest supported nice value, setpriority() sets the nice value to the lowest supported value. If value+NZERO is greater than the system's highest supported nice value, setpriority() sets the nice value to the highest supported value. Only a process with appropriate privileges can lower the nice value. Any process or thread using SCHED_FIFO or SCHED_RR is unaffected by a call to setpriority(). This is not considered an error. A process or thread that subsequently reverts to SCHED_OTHER will not have its priority affected by such a setpriority() call. The effect of changing the nice value varies depending on the scheduling policy in effect. Since getpriority() can return the value -1 on successful completion, it is necessary to set errno to 0 prior to a call to getpriority(). If getpriority() returns the value -1, then errno can be checked to see if an error occurred or if the value is a legitimate nice value. RETURN VALUES
Upon successful completion, getpriority() returns an integer in the range from -NZERO to NZERO-1. Otherwise, -1 is returned and errno is set to indicate the error. Upon successful completion, setpriority() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The getpriority() and setpriority() functions will fail if: ESRCH No process or thread could be located using the which and who argument values specified. EINVAL The value of the which argument was not recognized, or the value of the who argument is not a valid process ID, process group ID, user ID, group ID, session ID, thread (lwp) ID, task ID, project ID, or zone ID. In addition, setpriority() may fail if: EPERM A process was located, but neither the real nor effective user ID of the executing process match the effective user ID of the process whose nice value is being changed. EACCES A request was made to change the nice value to a lower numeric value and the current process does not have appropriate privi- leges. EXAMPLES
Example 1 Example using getpriority() The following example returns the current scheduling priority for the process ID returned by the call to getpid(2). #include <sys/resource.h> ... int which = PRIO_PROCESS; id_t pid; int ret; pid = getpid(); ret = getpriority(which, pid); Example 2 Example using setpriority() The following example sets the nice value for the current process to 0. #include <sys/resource.h> ... int which = PRIO_PROCESS; id_t pid; int value = -20; int ret; pid = getpid(); ret = setpriority(which, pid, value); USAGE
The getpriority() and setpriority() functions work with an offset nice value (value-NZERO). The nice value is in the range 0 to 2*NZERO-1, while the return value for getpriority() and the third parameter for setpriority() are in the range -NZERO to NZERO-1. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |Standard |See standards(5). | +-----------------------------+-----------------------------+ SEE ALSO
nice(1), renice(1), sched_get_priority_max(3C), sched_setscheduler(3C), attributes(5), standards(5) SunOS 5.11 1 Apr 2008 getpriority(3C)
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy