Back to index

glibc  2.9
Defines | Functions
mach.h File Reference
#include <features.h>
#include <mach/mach_types.h>
#include <mach_init.h>
#include <mach/mach_traps.h>
#include <mach/mach_interface.h>
#include <mach/mach_port.h>
#include <mach/mach_host.h>
#include <mach-shortcuts.h>
#include <stdio.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __need_FILE

Functions

mach_msg_return_t __mach_msg_server (boolean_t(*__demux)(mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name)
mach_msg_return_t mach_msg_server (boolean_t(*__demux)(mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name)
mach_msg_return_t __mach_msg_server_timeout (boolean_t(*__demux)(mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name, mach_msg_option_t __option, mach_msg_timeout_t __timeout)
mach_msg_return_t mach_msg_server_timeout (boolean_t(*__demux)(mach_msg_header_t *__request, mach_msg_header_t *__reply), mach_msg_size_t __max_size, mach_port_t __rcv_name, mach_msg_option_t __option, mach_msg_timeout_t __timeout)
void __mach_msg_destroy (mach_msg_header_t *msg)
void mach_msg_destroy (mach_msg_header_t *msg)
FILEmach_open_devstream (mach_port_t device_port, const char *mode)
kern_return_t __mach_setup_thread (task_t task, thread_t thread, void *pc, vm_address_t *stack_base, vm_size_t *stack_size)
kern_return_t mach_setup_thread (task_t task, thread_t thread, void *pc, vm_address_t *stack_base, vm_size_t *stack_size)

Define Documentation

#define __need_FILE

Definition at line 84 of file mach.h.


Function Documentation

void __mach_msg_destroy ( mach_msg_header_t *  msg)

Here is the caller graph for this function:

mach_msg_return_t __mach_msg_server ( boolean_t(*)(mach_msg_header_t *__request, mach_msg_header_t *__reply)  __demux,
mach_msg_size_t  __max_size,
mach_port_t  __rcv_name 
)

Here is the caller graph for this function:

mach_msg_return_t __mach_msg_server_timeout ( boolean_t(*)(mach_msg_header_t *__request, mach_msg_header_t *__reply)  __demux,
mach_msg_size_t  __max_size,
mach_port_t  __rcv_name,
mach_msg_option_t  __option,
mach_msg_timeout_t  __timeout 
)

Here is the caller graph for this function:

kern_return_t __mach_setup_thread ( task_t  task,
thread_t  thread,
void *  pc,
vm_address_t *  stack_base,
vm_size_t *  stack_size 
)

Definition at line 36 of file setup-thread.c.

{
  kern_return_t error;
  struct machine_thread_state ts;
  mach_msg_type_number_t tssize = MACHINE_THREAD_STATE_COUNT;
  vm_address_t stack;
  vm_size_t size;
  int anywhere;

  size = stack_size ? *stack_size ? : STACK_SIZE : STACK_SIZE;
  stack = stack_base ? *stack_base ? : 0 : 0;
  anywhere = !stack_base || !*stack_base;

  error = __vm_allocate (task, &stack, size + __vm_page_size, anywhere);
  if (error)
    return error;

  if (stack_size)
    *stack_size = size;

  memset (&ts, 0, sizeof (ts));
  MACHINE_THREAD_STATE_SET_PC (&ts, pc);
#ifdef STACK_GROWTH_DOWN
  if (stack_base)
    *stack_base = stack + __vm_page_size;
  ts.SP = stack + __vm_page_size + size;
#elif defined (STACK_GROWTH_UP)
  if (stack_base)
    *stack_base = stack;
  ts.SP = stack;
  stack += size;
#else
  #error stack direction unknown
#endif

  /* Create the red zone.  */
  if (error = __vm_protect (task, stack, __vm_page_size, 0, VM_PROT_NONE))
    return error;

  return __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR,
                          (natural_t *) &ts, tssize);
}

Here is the caller graph for this function:

void mach_msg_destroy ( mach_msg_header_t *  msg)
mach_msg_return_t mach_msg_server ( boolean_t(*)(mach_msg_header_t *__request, mach_msg_header_t *__reply)  __demux,
mach_msg_size_t  __max_size,
mach_port_t  __rcv_name 
)
mach_msg_return_t mach_msg_server_timeout ( boolean_t(*)(mach_msg_header_t *__request, mach_msg_header_t *__reply)  __demux,
mach_msg_size_t  __max_size,
mach_port_t  __rcv_name,
mach_msg_option_t  __option,
mach_msg_timeout_t  __timeout 
)
FILE* mach_open_devstream ( mach_port_t  device_port,
const char *  mode 
)

Definition at line 131 of file devstream.c.

{
  FILE *stream;

  if (mach_port_mod_refs (mach_task_self (), dev, MACH_PORT_RIGHT_SEND, 1))
    {
      errno = EINVAL;
      return NULL;
    }

  stream = fopencookie ((void *) dev, mode,
                     (cookie_io_functions_t) { write: devstream_write,
                                            read: devstream_read,
                                            close: dealloc_ref });
  if (stream == NULL)
    {
      mach_port_deallocate (mach_task_self (), dev);
      return NULL;
    }

  return stream;
}

Here is the call graph for this function:

kern_return_t mach_setup_thread ( task_t  task,
thread_t  thread,
void *  pc,
vm_address_t *  stack_base,
vm_size_t *  stack_size 
)