src/os/win32/ngx_os.h - nginx source code

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_OS_H_INCLUDED_
  6. #define _NGX_OS_H_INCLUDED_


  7. #include <ngx_config.h>
  8. #include <ngx_core.h>


  9. #define NGX_IO_SENDFILE    1


  10. typedef ssize_t (*ngx_recv_pt)(ngx_connection_t *c, u_char *buf, size_t size);
  11. typedef ssize_t (*ngx_recv_chain_pt)(ngx_connection_t *c, ngx_chain_t *in,
  12.     off_t limit);
  13. typedef ssize_t (*ngx_send_pt)(ngx_connection_t *c, u_char *buf, size_t size);
  14. typedef ngx_chain_t *(*ngx_send_chain_pt)(ngx_connection_t *c, ngx_chain_t *in,
  15.     off_t limit);

  16. typedef struct {
  17.     ngx_recv_pt        recv;
  18.     ngx_recv_chain_pt  recv_chain;
  19.     ngx_recv_pt        udp_recv;
  20.     ngx_send_pt        send;
  21.     ngx_send_pt        udp_send;
  22.     ngx_send_chain_pt  udp_send_chain;
  23.     ngx_send_chain_pt  send_chain;
  24.     ngx_uint_t         flags;
  25. } ngx_os_io_t;


  26. ngx_int_t ngx_os_init(ngx_log_t *log);
  27. void ngx_os_status(ngx_log_t *log);
  28. ngx_int_t ngx_os_signal_process(ngx_cycle_t *cycle, char *sig, ngx_pid_t pid);

  29. ssize_t ngx_wsarecv(ngx_connection_t *c, u_char *buf, size_t size);
  30. ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, u_char *buf, size_t size);
  31. ssize_t ngx_udp_wsarecv(ngx_connection_t *c, u_char *buf, size_t size);
  32. ssize_t ngx_udp_overlapped_wsarecv(ngx_connection_t *c, u_char *buf,
  33.     size_t size);
  34. ssize_t ngx_wsarecv_chain(ngx_connection_t *c, ngx_chain_t *chain, off_t limit);
  35. ssize_t ngx_wsasend(ngx_connection_t *c, u_char *buf, size_t size);
  36. ssize_t ngx_overlapped_wsasend(ngx_connection_t *c, u_char *buf, size_t size);
  37. ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in,
  38.     off_t limit);
  39. ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in,
  40.     off_t limit);

  41. void ngx_cdecl ngx_event_log(ngx_err_t err, const char *fmt, ...);


  42. extern ngx_os_io_t  ngx_os_io;
  43. extern ngx_uint_t   ngx_ncpu;
  44. extern ngx_uint_t   ngx_max_wsabufs;
  45. extern ngx_int_t    ngx_max_sockets;
  46. extern ngx_uint_t   ngx_inherited_nonblocking;
  47. extern ngx_uint_t   ngx_tcp_nodelay_and_tcp_nopush;
  48. extern ngx_uint_t   ngx_win32_version;
  49. extern char         ngx_unique[];


  50. #endif /* _NGX_OS_H_INCLUDED_ */