I have a requirement to close all the file descriptors from 3 to 1024 for a particular application.
Right now, this is how I do it ..
for ( int i = 3 ; i <= 1024; ++i )
close(i);
The change I am looking at is, I want to do away with the number 1024 and replace it with a constant which... (4 Replies)
Hello,
I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^
Here is what I'm trying to achieve :
file1:
test filea 3495;
test fileb 4578;
test filec 7689;
test filey 9978;
test filez 12300;
file2:
test filea... (11 Replies)
Hi Experts,
I have a requirement where i need to update the below items in file,
1. END TIME
2. PREV_STATUS
For the first time the PREV_status and end time of all job the job will be sysdate & NULL reply as below,
Session_name,Load Type,Frequency,Seesion End time,Prev_Status... (2 Replies)
Hi, I need to edit a file Protein Data Bank (pdb) and then open that file with the program VMD but when I edit the file with awk, it changes pdb format and the VMD program can not read it.
I need to subtract 34 to field 6 ($ 6).
this is a pdb file :
ATOM 918 N GLY B 103 -11.855 8.675... (8 Replies)
Hi
I need some help with a task, i am an absolute newbie to any form of shell scripting and request guidance.
Task:
1. Read a config file in form of name value pair
ex
host=www.test.com
port=8080
binding="dynamic" or "other" or "something else"
key1=value1
key2=value2
key3=value4... (4 Replies)
I have to do a read operation for a field in property file, which looks like follows:
123|xyz|datetime|count
'|' is delimiter.
Finally I managed to read the contents of property file using statement like
cut -d"|" -f1 $PROPERTIES_FILE | tr '\n' ' ' <-- Reading first column
But now I... (2 Replies)
Hi guys,
I am writing a Makefile with some strange features.
What I have is:
list of files *.efi
list of guids (guid is just a number)
one *.efi file is supposed to be used with one guid, so efi file and guid is a pair.
What I need is:
list of files *.fv
How to make *.fv file... (1 Reply)
Hi gurus,
I wanted to split main file in 20 files with 2500 lines in each file. My main file conatins total 2500*20 lines. Following awk I made, but it is breaking with error.
awk '{ for (i = 1; i <= 20; i++) { starts=2500*$i-1; ends=2500*$i; NR>=starts && NR<=ends {f=My$i".txt"; print >> f;... (10 Replies)
I am very new to scripting and I know this request is simple but I am having no luck with it.
I have a file a.dat with the following data in it.
aa
bb
cc
dd
I need to run a script that will take each line of a.dat and put dsjc/ubin/ in front of each record, so the output looks like
... (2 Replies)
Hi,
I am converting a .DBF file to pipe delimited file
my requirement is like
lets say my .DBF is residing in path /a/b/c/d/f/abc.DBF
I need my .txt file as
having a column with source _cd =f
sample data in .DBF in folder "f"
c1 c2 c3
1 2 3
in txt file it should be... (4 Replies)
Discussion started by: angel12345
4 Replies
LEARN ABOUT NETBSD
do_setresuid
DO_SETRESUID(9) BSD Kernel Developer's Manual DO_SETRESUID(9)NAME
do_setresuid, do_setresgid -- set process uid and gid
SYNOPSIS
#include <sys/ucred.h>
int
do_setresuid(struct lwp *lwp, uid_t ruid, uid_t euid, uid_t svuid, u_int flags);
int
do_setresgid(struct lwp *lwp, uid_t ruid, uid_t euid, uid_t svuid, u_int flags);
DESCRIPTION
The do_setresuid and do_setresgid functions are used to implement the various system calls that allow a process to change its real, effec-
tive, and saved uid and gid values.
The do_setresuid function sets the specified processes real user ID to ruid, its effective user ID to euid, and its saved user ID to svuid.
If any of the uid arguments are -1 then that assignment is skipped.
If suser() is true, then any values may be assigned, otherwise the new uid values must match one of the existing values and the caller must
have set the relevant bit in flags.
The flags argument specifies which of the existing uid values the new value must match. It should be set to a logical OR of
ID_{R,E,S}_EQ_{R,E,S}, where ID_E_EQ_R means that it is valid to set the effective ID to the current value of the real ID.
The do_setresgid function sets the group IDs but otherwise behaves in the same manner as do_setresuid. The processes group list is neither
examined nor effected.
SEE ALSO setregid(2), setreuid(2), setuid(2), suser(9)CODE REFERENCES
These functions are implemented in: sys/kern/kern_prot.c.
HISTORY
Implemented for NetBSD 2.0 to replace ad-hoc code in each system call routine and in the various compat modules.
BSD September 28, 2003 BSD