


     glob(XPG4.os/genutsRelease	4.4.1 (UniSoft Ltdglob(XPG4.os/genuts)



     NAME
	  XPG4.os/genuts/glob -	generate pathnames matching a pattern
	  testset

     DESCRIPTION
	  Tests	the glob() and globfree() system call interfaces for
	  conformance to the XSI System	Interfaces Page:glob()

     TESTS
     Compliance
	  1    If glob() is supported:
		   When	a call to glob() has read permission on	each
		   directory of	any filename component of pattern that
		   contains any	of the special characters *, ? or [
		   and has search permission on	every component	of a
		   path	except the last, then glob() completes
		   successfully	without	calling	the error function
		   errfunc.
		   Testing Requirements: Test with patterns containing
		   these special characters and	patterns which do not
		   contain these characters.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  2    If glob() is supported:
		   The glob() function creates a list of all
		   accessible pathnames	which match the	argument
		   pattern.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  3    If glob() is supported:
		   When	pattern	is a single character other than
		   newline, and	unquoted ?, * or [ then	a call to
		   glob() matches the pattern to a file	with the same
		   name.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  4    If glob() is supported:
		   When	pattern	contains the characters	?, * and [
		   inside a bracket expression,	then a call to glob()
		   attaches no special meaning to those	characters.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  5    If glob() is supported:
		   When	pattern	contains a concatenation of patterns,



     Page 1					    (printed 2/21/103)






     glob(XPG4.os/genutsRelease	4.4.1 (UniSoft Ltdglob(XPG4.os/genuts)



		   each	of which match a single	character, then	a call
		   to glob() matches pattern to	pathnames which	are
		   the concatenation of	the characters matched by each
		   pattern.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  6    If glob() is supported:
		   The glob() function only matches a slash in a
		   pathname to an explicit slash character in pattern.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  7    If glob() is supported:
		   When	pattern	contains *, then a call	to glob()
		   matches the * to any	characters except slash,
		   leading dot and dot following slash.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  8    If glob() is supported:
		   When	pattern	contains ?, then a call	to glob()
		   matches the ? to any	single character except	slash,
		   leading dot and dot following slash.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  9    If glob() is supported:
		   When	pattern	contains [s], then a call to glob()
		   matches the [s] to any one of the characters	in the
		   set s except	slash, leading dot and dot following
		   slash.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  10   Not in use.

	  11   If glob() is supported:
		   When	pattern	contains [!s], then a call to glob()
		   matches the [!s] to any characters not in the set s
		   except slash, leading dot and dot following slash.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  12   If glob() is supported:
		   When	pattern	commences with a slash character, then



     Page 2					    (printed 2/21/103)






     glob(XPG4.os/genutsRelease	4.4.1 (UniSoft Ltdglob(XPG4.os/genuts)



		   a call to glob() commences searching	for matching
		   filenames at	the calling process' root directory.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  13   If glob() is supported:
		   When	pattern	does not commence with a slash
		   character, then a call to glob() commences
		   searching for matching filenames at the calling
		   process' current working directory, interpreting an
		   explicit pathname element of	dot-dot	(..) as	the
		   parent directory of the previous pathname element.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  14   If glob() is supported:
		   A successful	call to	glob() returns a value of
		   zero, sets the gl_pathc structure member of the
		   argument addressed by pglob to the number of
		   matched pathnames and sets the gl_pathv structure
		   member to contain a pointer to a null-terminated
		   list	of matched and sorted pathnames.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  15   If glob() is supported:
		   When	the GLOB_NOSORT	flag is	not set	in the flags
		   argument, then pathnames returned by	glob() are
		   sorted according to collation sequence
		   corresponding to the	value of the current setting
		   of the LC_COLLATE category.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  16   If glob() is supported:
		   When	the GLOB_NOCHECK flag is not set in the	flags
		   argument and	no pathnames are found which match
		   pattern, then the gl_pathc structure	member of the
		   pglob argument is set to zero.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  17   If glob() is supported:
		   A call to glob() allocates the memory pointed to by
		   the gl_pathv	structure member addressed by the
		   pglob argument.
	       Otherwise:



     Page 3					    (printed 2/21/103)






     glob(XPG4.os/genutsRelease	4.4.1 (UniSoft Ltdglob(XPG4.os/genuts)



		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  18   If globfree() is	supported:
		   When	the pglob argument refers to a structure whose
		   address was supplied	to a previous call to glob(),
		   then	a call to globfree() frees any space
		   associated with the structure addressed by pglob.
	       Otherwise:
		   A call to globfree()	sets errno to ENOSYS.

	  19   If glob() is supported:
		   When	the GLOB_APPEND	flag is	set in flags, then the
		   pathnames generated from this call to glob()	are
		   stored in the gl_pathv element of the structure
		   addressed by	pglob after the	current	set of
		   pathnames, which remain unchanged, and the gl_pathc
		   element of the structure is updated to provide the
		   total number	of elements from the two calls.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  20   If glob() is supported:
		   When	the GLOB_DOOFFS	flag is	set in flags, then a
		   call	to glob() commences the	array of pointers in
		   the gl_pathv	element	of the structure addressed by
		   pglob with the number of NULL pointers specified in
		   the gl_offs element of the structure	and follows
		   this	with gl_pathc pathname pointers, followed by
		   the terminating NULL	pointer.
		   Test	with the GLOB_APPEND flag set and with this
		   flag	clear.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  21   If glob() is supported:
		   When	the GLOB_ERR flag is not set in	flags, errfunc
		   is NULL and a call to glob()	encounters a directory
		   which cannot	be opened or read, then	the call to
		   glob() ignores the error and	continues to generate
		   other matching filenames.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  22   If glob() is supported:
		   When	the GLOB_MARK flag is set in flags and a
		   pathname that matches pattern is a directory, then
		   a call to glob() appends a slash to the
		   corresponding pathname referenced by	the gl_pathv



     Page 4					    (printed 2/21/103)






     glob(XPG4.os/genutsRelease	4.4.1 (UniSoft Ltdglob(XPG4.os/genuts)



		   structure element.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  23   If glob() is supported:
		   When	the GLOB_NOCHECK flag is set in	flags and
		   pattern does	not match any pathnames, then a	call
		   to glob() sets the gl_pathv structure element of
		   pglob to pattern and	sets the gl_pathc structure
		   element to 1.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  24   If glob() is supported:
		   When	the GLOB_NOSORT	flag is	set in flags, then a
		   call	to glob() returns a list of matching pathnames
		   in the gl_pathv structure element of	pglob in an
		   unspecified order.
		   Testing Requirements: Test the contents of gl_pathv
		   without assuming any	specific order.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  25   If glob() is supported:
		   When	the GLOB_NOESCAPE flag is not set in flags and
		   pattern contains one	or more	character pairs
		   commencing with a backslash character (\), then a
		   call	to glob() matches the second character in the
		   pair	with the same character	in a filename.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  26   If glob() is supported:
		   When	the GLOB_NOESCAPE flag is set in flags and
		   pattern contains one	or more	backslash characters
		   (\),	then a call to glob() matches the backslash
		   character with the same character in	a filename.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  27   If glob() is supported:
		   When	a directory is encountered that	cannot be
		   opened or read during the search and	errfunc	is not
		   NULL, then a	call to	glob() executes	a call to the
		   function errfunc with the two arguments epath,
		   which points	to the name of the path	that failed,
		   and eerrno which is the value of errno as set by



     Page 5					    (printed 2/21/103)






     glob(XPG4.os/genutsRelease	4.4.1 (UniSoft Ltdglob(XPG4.os/genuts)



		   the opendir(), readdir(), or	stat() functions.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  28   If glob() is supported:
		   When	the GLOB_ERR flag is not set in	flags, a call
		   to glob() encounters	a directory which cannot be
		   opened or read and the ensuing call to errfunc()
		   returns zero, then the call to glob() ignores the
		   error and continues to generate other matching
		   filenames.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

     Deviance
	  29   If glob() is supported:
		   When	the GLOB_ERR flag is set in flags and a	call
		   to glob() encounters	a directory which cannot be
		   opened or read, then	the error return value
		   GLOB_ABORTED	is returned and	the gl_pathc and
		   gl_pathv structure elements are set to reflect the
		   set of filenames generated prior to the directory
		   being encountered.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  30   If glob() is supported:
		   When	a call to glob() encounters a directory	which
		   cannot be opened or read and	the (*errfunc)() is
		   called and returns non-zero,	then the error return
		   value GLOB_ABORTED is returned and the gl_pathc and
		   gl_pathv structure elements are set to reflect the
		   set of filenames generated prior to the directory
		   being encountered.
		   Testing Requirements: Test with GLOB_ERR set	and
		   unset.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.

	  31   If glob() is supported:
		   When	the GLOB_NOCHECK flag is not set in flags and
		   pattern does	not match any pathnames, then a	call
		   to glob() sets the gl_pathc structure element of
		   pglob to 0 and returns GLOB_NOMATCH.
	       Otherwise:
		   A call to glob() returns GLOB_NOSYS and sets	errno
		   to ENOSYS.




     Page 6					    (printed 2/21/103)






     glob(XPG4.os/genutsRelease	4.4.1 (UniSoft Ltdglob(XPG4.os/genuts)



     Untestable	Aspects
	  1    When a call to glob() fails in an attempt to allocate
	       memory, then the	error return value GLOB_NOSPACE	is
	       returned.

     OUTPUTS
     Tests:
	  1-28 Pass/Fail indication - failure information includes
	       expected	and detected return values.

	  29-31
	       Pass/Fail indication - failure information includes
	       expected	and detected error numbers and return values.

     RELEASE
	  4.4.1	(06/09/97)







































     Page 7					    (printed 2/21/103)



