*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> Tk/send (3)              
Title
Content
Arch
Section
 

Contents


send(3Tk)							     send(3Tk)


NAME    [Toc]    [Back]

     send - Execute a command in a different application

SYNOPSIS    [Toc]    [Back]

     send ?options? app	cmd ?arg arg ...?				      |

DESCRIPTION    [Toc]    [Back]

     This command arranges for cmd (and	args) to be executed in	the
     application named by app.	It returns the result or error from that
     command execution.	 App may be the	name of	any application	whose main
     window is on the display containing the sender's main window;  it need
     not be within the same process.  If no arg	arguments are present, then
     the command to be executed	is contained entirely within the cmd argument.
     If	one or more args are present, they are concatenated to form the
     command to	be executed, just as for the eval command.

     If	the initial arguments of the command begin with	``-'' they are treated
     as	options.  The following	options	are currently defined:

     -async
	  Requests asynchronous	invocation.  In	this case the send command    |
	  will complete	immediately without waiting for	cmd to complete	in the|
	  target application.  If the target application is in the same	      |
	  process as the sending application then the -async option is	      |
	  ignored.

     -displayof	pathName
	  Specifies that the target application's main window is on the	      |
	  display of the window	given by pathName, instead of the display     |
	  containing the application's main window.

     --	  Serves no purpose except to terminate	the list of options.  This    |
	  option is needed only	if app could contain a leading ``-''	      |
	  character.

APPLICATION NAMES    [Toc]    [Back]

     The name of an application	is set initially from the name of the program
     or	script that created the	application.  You can query and	change the
     name of an	application with the tk	appname	command.

DISABLING SENDS    [Toc]    [Back]

     If	the send command is removed from an application	(e.g.  with the
     command rename send {}) then the application will not respond to incoming
     send requests anymore,  nor will it be able to issue outgoing requests.
     Communication can be reenabled by invoking	the tk appname command.







									Page 1






send(3Tk)							     send(3Tk)


SECURITY    [Toc]    [Back]

     The send command is potentially a serious security	loophole, since	any
     application that can connect to your X server can send scripts to your
     applications.  These incoming scripts can use Tcl to read and write your
     files and invoke subprocesses under your name.  Host-based	access control
     such as that provided by xhost is particularly insecure, since it allows
     anyone with an account on particular hosts	to connect to your server, and
     if	disabled it allows anyone anywhere to connect to your server.  In
     order to provide at least a small amount of security, Tk checks the
     access control being used by the server and rejects incoming sends	unless
     (a) xhost-style access control is enabled (i.e. only certain hosts	can
     establish connections) and	(b) the	list of	enabled	hosts is empty.	 This
     means that	applications cannot connect to your server unless they use
     some other	form of	authorization such as that provide by xauth.

KEYWORDS    [Toc]    [Back]

     application, name,	remote execution, security, send
send(3N)							      send(3N)


NAME    [Toc]    [Back]

     send, sendto, sendmsg - send a message from a socket

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>

     int send(int s, char *msg,	int len, int flags);

     int sendto(int s, char *msg, int len, int flags, caddr_t to,
	 int tolen);

     int sendmsg(int s,	msghdr *msg, int flags);

DESCRIPTION    [Toc]    [Back]

     s is a socket created with	socket.	 send, sendto, and sendmsg are used to
     transmit a	message	to another socket.  send may be	used only when the
     socket is in a connected state, while sendto and sendmsg may be used at
     any time.

     The address of the	target is given	by to with tolen specifying its	size.
     The length	of the message is given	by len.	 If the	message	is too long to
     pass atomically through the underlying protocol, then the error EMSGSIZE
     is	returned, and the message is not transmitted.

     No	indication of failure to deliver is implicit in	a send.	 Return	values
     of	-1 indicate some locally detected errors.

     If	no buffer space	is available at	the socket to hold the message to be
     transmitted, then send normally blocks, unless the	socket has been	placed
     in	non-blocking I/O mode [see fcntl(2)].  The select call may be used to
     determine when it is possible to send more	data.

     The flags parameter is formed by ORing one	or more	of the following:

     MSG_OOB   Send out-of-band	data on	sockets	that support this notion. The
	       underlying protocol must	also support out-of-band data.
	       Currently, only SOCK_STREAM sockets created in the AF_INET
	       address family support out-of-band data.

     MSG_DONTROUTE
	       The SO_DONTROUTE	option is turned on for	the duration of	the
	       operation.  It is used only by diagnostic or routing programs.

     See recv(3N) for a	description of the msghdr structure.

RETURN VALUE    [Toc]    [Back]

     These calls return	the number of bytes sent, or -1	if an error occurred.

ERRORS    [Toc]    [Back]

     The calls fail if:





									Page 1






send(3N)							      send(3N)



     EBADF		 s is an invalid descriptor.

     ENOTSOCK		 s is a	descriptor for a file, not a socket.

     EINVAL		 tolen is not the size of a valid address for the
			 specified address family.

     EINTR		 The operation was interrupted by delivery of a	signal
			 before	any data could be buffered to be sent.

     EMSGSIZE		 The socket requires that message be sent atomically,
			 and the message was too long.

     EWOULDBLOCK	 The socket is marked non-blocking and the requested
			 operation would block.

     ENOMEM		 There was insufficient	user memory available for the
			 operation to complete.

     ENOSR		 There were insufficient STREAMS resources available
			 for the operation to complete.

SEE ALSO    [Toc]    [Back]

      
      
     fcntl(2), write(2), connect(3N), getsockopt(3N), recv(3N),	socket(3N)

NOTES    [Toc]    [Back]

     The type of address structure passed to accept depends on the address
     family.  UNIX domain sockets (address family AF_UNIX) require a
     socketaddr_un structure as	defined	in sys/un.h; Internet domain sockets
     (address family AF_INET) require a	sockaddr_in structure as defined in
     netinet/in.h.  Other address families may require other structures.  Use
     the structure appropriate to the address family; cast the structure
     address to	a generic caddr_t in the call to send and pass the size	of the
     structure in the tolen argument.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
sudo OpenBSD execute a command as another user
system Tru64 Execute a shell command
system Linux execute a shell command
array IRIX execute an array command
pagsh OpenBSD execute a command without authentication
on IRIX execute a command remotely
command IRIX execute a simple command
command HP-UX execute a simple command
uuxqt IRIX execute remote command requests
after IRIX Execute a command after a time delay
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service