i had to split one files into 10 equally. For that i have coded below awk.
but the pth is not parsing or i don't know what is happening i am getting below error
but when i remove pth or directory it runs fine and generate files in current directory. like below.
but i want to create file in some directory only and i cannot hard code it.
Kindly help on this.
Hello,
i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem.
my var1 is a string constructed like this:
filename1 filerev1 filepath1
my var2 is another string constructed like this:
filename2 filerev2 filepath2
when i do... (2 Replies)
I need to write a login script for multiple computers, however, one of the directories in question will have a different name from computer to computer.
~/Library/Application\ Support/Firefox/Profiles/<unique filename>.default/myfile
For the directory named <unique filename>.default , I... (2 Replies)
I've been working on a UNIX script (csh) that will be starting a java application
The goal is to get the version number and location (needed by the application) from the path of the script
Example:
Location of the script= /apps/myapp/versionNum/script/start.csh
I need:... (8 Replies)
I'm trying to write my first shell script and got a bit stuck with this:
I've got myscript.sh that executes from /fromhere.
If the script is run with the syntax ./myscript.sh tothere:
I need to make a variable inside the script containing /fromhere/tothere
...and if the script is run with... (10 Replies)
Hi,
I have following path:
set file_path = D:/forums/prac/somedir/new1/file1.txt
or set file_path = E:/new/forums1/prac/somedir/new2/file2.txt
I need to grep "somedir" from file path. In this case preceding directory "prac" remains same for both the paths, but directories preceding... (7 Replies)
I have a script like this running under OS X 10.8. The problem arises when the find command encounters a space in the path name. I need the "dir" variable as I'll be extending the script to more general use.
#!/bin/bash
CFS=$IFS
IFS=$(echo)
set dir = "/Users/apta/Library/Mail\... (3 Replies)
Hi All,
Need some help in parsing a directory listing .. output into 2 files
Input file
level1,/level2/level3/level4/ora001,10,IBB23
level1,/level2/level3/level4/ora001/blu1,,IBB23
level1,/level2/level3/level4/ora001/clu1,,IBB23
level1,/level2/level3/level4/ora002,,IBB24... (10 Replies)
What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
LEARN ABOUT NETBSD
pthread_getaffinity_np
AFFINITY(3) BSD Library Functions Manual AFFINITY(3)NAME
pthread_setaffinity_np, pthread_getaffinity_np -- affinity of threads
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
#include <sched.h>
int
pthread_setaffinity_np(pthread_t thread, size_t size, cpuset_t *set);
int
pthread_getaffinity_np(pthread_t thread, size_t size, cpuset_t *set);
DESCRIPTION
Thread affinity allows to run the thread on specified CPU or CPUs only.
The pthread_setaffinity_np() function sets the affinity mask set for thread. At least one valid CPU must be set in the mask.
The pthread_getaffinity_np() function gets the affinity mask of thread into set. Note that set must be created and initialized using the
cpuset(3) functions.
IMPLEMENTATION NOTES
Setting CPU pthread_setaffinity_np requires super-user privileges. Ordinary users can be allowed to control CPU affinity of their threads
via the security.models.extensions.user_set_cpu_affinity sysctl(7). See secmodel_extensions(9).
Portable applications should not use the pthread_setaffinity_np() and pthread_getaffinity_np() functions.
RETURN VALUES
The pthread_setaffinity_np() and pthread_getaffinity_np() functions return 0 on success. Otherwise, an error number is returned to indicate
the error.
EXAMPLES
An example of code fragment, which sets the affinity for the current thread to the CPU whose ID is 0:
cpuset_t *cset;
pthread_t pth;
cpuid_t ci;
cset = cpuset_create();
if (cset == NULL) {
err(EXIT_FAILURE, "cpuset_create");
}
ci = 0;
cpuset_set(ci, cset);
pth = pthread_self();
error = pthread_setaffinity_np(pth, cpuset_size(cset), cset);
if (error) {
...
}
cpuset_destroy(cset);
COMPATIBILITY
Both functions are non-standard extensions.
ERRORS
Both functions may fail if:
[EINVAL] The specified set was invalid.
[EPERM] The calling process lacks the appropriate privileges to perform the operation.
[ESRCH] No thread could be found corresponding to the one specified by thread.
NOTES
There is an alternative processor sets interface, see pset(3). However, thread affinity and processor sets are mutually exclusive, hence
mixing of these interfaces is prohibited.
SEE ALSO cpuset(3), pset(3), pthread_getschedparam(3), pthread_setschedparam(3), sched(3), schedctl(8)BSD December 4, 2011 BSD