delorie.com/djgpp/doc/libc/libc_143.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

__djgpp_set_page_attributes

Syntax

 
#include <dpmi.h>

int __djgpp_set_page_attributes(void *our_addr, unsigned long num_bytes,
			        unsigned short attributes);

Description

This function sets the DPMI page attributes for the pages in a range of memory. our_addr and num_bytes must be page-aligned. If they are not page-aligned, errno will be set to EINVAL and the routine will fail.

Consult DPMI documentation on function 0507H for the meaning of the attributes argument. Note: since 0507H is a DPMI service new with DPMI 1.0, this call will fail on most DPMI 0.9 servers. For your program to work on a wide range of systems, you should not assume this call will succeed.

Even on failure, this routine may affect a subset of the pages specified.

Return Value

0 on success, -1 on failure. On failure, errno will be set to EINVAL for illegal input parameters, or EACCES if the DPMI server rejected the attribute setting.

Portability

ANSI/ISO C No
POSIX No

Example

 
if (__djgpp_set_page_attributes (my_page_aligned_memory, 16384, 0))
  printf ("Failed to make pages uncommitted!\n");

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004