PXENV_FILE_EXEC
[PXE FILE API]

FILE EXEC. More...


Data Structures

struct  s_PXENV_FILE_EXEC
 Parameter block for pxenv_file_exec(). More...

Defines

#define PXENV_FILE_EXEC   0x00e5
 PXE API function code for pxenv_file_exec().

Typedefs

typedef struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t

Functions

PXENV_EXIT_t pxenv_file_exec (struct s_PXENV_FILE_EXEC *file_exec)
 FILE EXEC.


Detailed Description

FILE EXEC.

Define Documentation

#define PXENV_FILE_EXEC   0x00e5

PXE API function code for pxenv_file_exec().

Definition at line 1741 of file pxe_api.h.

Referenced by pxe_api_call().


Typedef Documentation

Definition at line 1749 of file pxe_api.h.


Function Documentation

PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC file_exec  ) 

FILE EXEC.

Parameters:
file_exec Pointer to a struct s_PXENV_FILE_EXEC
s_PXENV_FILE_EXEC::Command Command to execute
Return values:
PXENV_EXIT_SUCCESS Command was executed successfully
PXENV_EXIT_FAILURE Command was not executed successfully
s_PXENV_FILE_EXEC::Status PXE status code

Definition at line 208 of file pxe_file.c.

References s_PXENV_FILE_EXEC::Command, copy_from_user(), DBG, s_SEGOFF16::offset, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, real_to_user(), s_SEGOFF16::segment, s_PXENV_FILE_EXEC::Status, strlen_user(), and system().

Referenced by pxe_api_call().

00208                                                                      {
00209         userptr_t command;
00210         size_t command_len;
00211         int rc;
00212 
00213         DBG ( "PXENV_FILE_EXEC" );
00214 
00215         /* Copy name from external program, and exec it */
00216         command = real_to_user ( file_exec->Command.segment,
00217                                  file_exec->Command.offset );
00218         command_len = strlen_user ( command, 0 );
00219         {
00220                 char command_string[ command_len + 1 ];
00221 
00222                 copy_from_user ( command_string, command, 0,
00223                                  sizeof ( command_string ) );
00224                 DBG ( " %s", command_string );
00225 
00226                 if ( ( rc = system ( command_string ) ) != 0 ) {
00227                         file_exec->Status = PXENV_STATUS ( rc );
00228                         return PXENV_EXIT_FAILURE;
00229                 }
00230         }
00231 
00232         file_exec->Status = PXENV_STATUS_SUCCESS;
00233         return PXENV_EXIT_SUCCESS;
00234 }


Generated on Tue Apr 6 20:01:59 2010 for gPXE by  doxygen 1.5.7.1