INDIR(2) System Calls Manual INDIR(2)NAME
indir - indirect system call
ASSEMBLER
(indir = 0.)
sys indir; call
The system call at the location call is executed. Execution resumes after the indir call.
The main purpose of indir is to allow a program to store arguments in system calls and execute them out of line in the data segment. This
preserves the purity of the text segment.
If indir is executed indirectly, it is a no-op. If the instruction at the indirect location is not a system call, indir returns error code
EINVAL; see intro(2).
INDIR(2)
Check Out this Related Man Page
shmop(2) System Calls Manual shmop(2)Name
shmop, shmat, shmdt - shared memory operations
Syntax
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
char *shmat (shmid, shmaddr, shmflg)
int shmid;
char *shmaddr;
int shmflg;
int shmdt (shmaddr)
char *shmaddr;
Description
The system call attaches the shared memory segment associated with the shared memory identifier specified by shmid to the data segment of
the calling process. The segment is attached at the address specified by one of the following criteria:
If shmaddr is equal to zero, the segment is attached at the first available address as selected by the system.
If shmaddr is not equal to zero and (shmflg & SHM_RND ) is true, the segment is attached at the address given by (shmaddr- (shmaddr modulus
SHMLBA )).
If shmaddr is not equal to zero and (shmflg & SHM_RND ) is false, the segment is attached at the address given by shmaddr.
The segment is attached for reading if (shmflg & SHM_RDONLY ) is true. Otherwise, it is attached for reading and writing.
The system call detaches from the calling process's data segment the shared memory segment located at the address specified by shmaddr.
Return Values
Upon successful completion, the return values are as follows:
o The system call returns the data segment start address of the attached shared memory segment.
o The system call returns a value of zero (0).
Otherwise, a value of -1 is returned, and errno is set to indicate the error.
Diagnostics
The system call fails and not attach the shared memory segment, if any of the following is true:
[EINVAL] The shmid is not a valid shared memory identifier.
[EACCES] Operation permission is denied to the calling process. For further information, see
[ENOMEM] The available data space is not large enough to accommodate the shared memory segment.
[EINVAL] The shmaddr is not equal to zero, and the value of (shmaddr- (shmaddr modulus SHMLBA )) is an illegal address.
[EINVAL] The shmaddr is not equal to zero, (shmflg & SHM_RND ) is false, and the value of shmaddr is an illegal address.
[EMFILE] The number of shared memory segments attached to the calling process would exceed the system imposed limit.
The fails and does not detach the shared memory segment if:
[EINVAL] The shmaddr is not the data segment start address of a shared memory segment.
See Alsoexecve(2), exit(2), fork(2), shmctl(2), shmget(2)shmop(2)
Hi everybody,
I have been going through a shell scripting book and I have been given a suggestion that says
${bindir} has an advantage over $bindir in the following scenario:
bindir="/usr/local/bin"
exceptions="${bindir}/exc" is better than
exceptions="$bindir/exc" and that the latter... (2 Replies)
Using bash, I'm trying to read a .properties file (name=value pairs), assigning an indirect variable reference for each line in the file.
The trick is that a property's value string may contain the name of a property that occurred earlier in the file, and I want the name of the 1st property to... (5 Replies)
I am running apache web server on CentOS5.2
I have the directory in which stores a lot of images.(/var/www/html/images)
I want to deny everyone from directly accessing the directory but still allow images in the directory to be used by HTML (/var/www/html/pic.html <img... (2 Replies)
Hi,
I've got a small problem.
If varible A stores "B" and Variable B stores C,
How to get the value of variable B by using only Variable A..?
I tried the following but didnt work pease help..
$ var1=vikram
$ echo $var1
vikram
$ vikram=sampath
$ echo $vikram
sampath
$ echo... (6 Replies)
Hi
I have variable A_B=alpha
also var1="A"
var2="B"
I want to retrieve the value alpha using var1 and var2 , somthing like
echo ${${var1}_${var2}} that works. Obviously this is receiving syntax
error (6 Replies)
Hello,
is there a kind soul who can answer me, does the SH support double substitution known as indirect expansion similar to BASH? The syntax for bash is ${!var}.
For instance in bash I can write something like this:
VAR="value"
REF_VAR="VAR"
echo ${!REF_VAR}
and get the "value"... (1 Reply)
I have a file with two columns of numbers (member IDs):
1 1
2 1
3 1
4 2
5 4
6 1
7 5
8 3
9 2
Think of column 1 as the referee and column 2 as the referrer.
Is there a good way to backtrack who referred who? I would like an output, for this example here to be:
1 1
2 1
3 1
4 2 1 (2 Replies)
Hello.
This an issue from previous thread :https://www.unix.com/shell-programming-scripting/185585-grep-extracting-multiple-key-words-stdout.html
In a script, I want to print what command is to be being executed.
Generally I use :
CMD="some simple command"
echo "COMMAND : $CMD"
$CMD
Now... (8 Replies)
Hello,
I've spent hours this morning reading various past forum posts and documentation pages but I can't find exactly what I need.
I'm trying to call a variable with a variable in the name without having to make a third variable.
For example:
path=AB
legAB=50
leg$path
I want to... (8 Replies)
Hi All,
I am really struggling to solve this problem, this might be small but I am not able to, can somebody help me?
I have few directories and these directories receives text files in large amount with in fraction of seconds. So I just want to send all the files in current directory to... (2 Replies)
Hi All,
I have a requirement where I have a config file, which contains 2 coulmn.values of first column are environmnet variable, whose value is defined in an environment file.
In my script I need to read the config file, and get the value of the config file variable from env file.
I... (2 Replies)
Hi,
I need a ksh script to replace indirect directory references in an .ini file with a env variable using sed or awk.
The .ini file is for example as such:
A=..
B=../
C=../..
D=../../
E=../bin
F=../../bin
G=../../bin/xml
H=../../bin/xml/
Need to replace an instance of .. or... (2 Replies)
Hello,
I'm trying to build a small script to store a command into a dynamic variable, and I have trouble assigning the variable.
#!/bin/bash
declare -a var1array=("value1" "value2" "value3")
var1arraylength=${#var1array}
for (( i=1; i<${var1arraylength}+1; i++ ));
do
mkdir... (7 Replies)