Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

indir(2) [v7 man page]

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 Also
       execve(2), exit(2), fork(2), shmctl(2), shmget(2)

																	  shmop(2)
Man Page

14 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

${bindir} vs $bindir

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)
Discussion started by: kishorebabu
2 Replies

2. UNIX for Advanced & Expert Users

Compound indirect variable references

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)
Discussion started by: tkrussel
5 Replies

3. UNIX for Dummies Questions & Answers

deny directly allow indirectly (.htaccess)

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)
Discussion started by: lifegeek
2 Replies

4. Linux

How to get an Indirect Variable Value..?

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)
Discussion started by: vickramshetty
6 Replies

5. Shell Programming and Scripting

Indirect variable assignment

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)
Discussion started by: sumir
6 Replies

6. Shell Programming and Scripting

Does SH support indirect expansion like BASH?

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)
Discussion started by: dimentiy
1 Replies

7. Shell Programming and Scripting

Indirect Referral Script

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)
Discussion started by: mdlloyd7
2 Replies

8. Shell Programming and Scripting

Variable indirection

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)
Discussion started by: jcdole
8 Replies

9. Shell Programming and Scripting

Indirect variables in Bash

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)
Discussion started by: DFr0st
8 Replies

10. Shell Programming and Scripting

Create, validate and using dynamic variables in Bash scripting

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)
Discussion started by: VasuKukkapalli
2 Replies

11. Shell Programming and Scripting

Treat value of variable as env variable

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)
Discussion started by: alok2082
2 Replies

12. Shell Programming and Scripting

Pattern match and replace indirect directory reference using sed

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)
Discussion started by: andyatit
2 Replies

13. Shell Programming and Scripting

Dynamic variable name in bash

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)
Discussion started by: alex2005
7 Replies

14. Shell Programming and Scripting

Download on a link doing it indirectly

How do I download on a link doing it indirectly, with once redirection by using curl commands or Bash script of them (2 Replies)
Discussion started by: abdan
2 Replies