R

Top  Previous  Next

raise

#include <signal.h>

int raise (

   int sig

);

stand-alone

This function raises the signal specified in sig.

 

Macros are provided to represent the allowed values of sig; they are SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV and SIGTERM.

 

The action taken when the signal is raised depends on what action has been specified for that signal by a call to the signal function. If no such call has been made, the default action is taken; that is, to return to the caller's program. If such a return is made, 0 is returned if the call was successful, or 1 if there was an error.

 

Note that the allowed signals are only raised in the current version by means of calls to raise; they never happen spontaneously.

rand

#include <stdlib.h>

int rand(void);

stand-alone

rand returns successive pseudo-random integers in the range 0 to RAND_MAX, a macro which is defined in stdlib.h to be 215-1.

realloc

#include <stdlib.h>

void *realloc (

   void   *ptr,

   size_t  size

);

stand-alone

ptr should point to a heap object previously allocated by a call to malloc, memalign, calloc or realloc.

 

realloc changes the size of the object pointed to by ptr to the size specified (in octets) by size. The function returns a pointer to the start of the possibly moved object. If the space cannot be allocated, the realloc function returns a null pointer and the object pointed to by ptr is unchanged.

 

If ptr is a null pointer, the equivalent of a call to malloc is performed, with the specified value of size as the number of octets (eight-bit bytes) required.

 

realloc may be used on an object previously allocated by memalign, but you should not assume that the resulting pointer meets any particular alignment constraints.

remove

#include <stdio.h>

int remove (

   const char *filename

);

server

The remove function causes the identified by the string pointed to by filename to be deleted. Subsequent attempts to open the file will fail, unless it is created anew.

 

Zero is returned if the file has been removed, non-zero if the operation failed.

rename

#include <stdio.h>

int rename (

   const char *old_name,

   const char *new_name

);

server

The file named old_name is renamed new_name. old_name and new_name are pointers to NUL-terminated character strings which must be valid host file names.

 

Zero is returned if the rename operation succeeds, non-zero if it fails.

 

The host operating system determines whether or not a particular file renaming operation can succeed.

rewind

#include <stdio.h>

void rewind (

   FILE *stream

);

server

rewind(f) is equivalent to (void) fseek(f,0L,SEEK_SET).

 

It repositions stream to the first character (character 0) of the associated file. It has no effect if the stream is associated with a device rather than a file (e.g. the keyboard or the screen).