|
FunctionThe vn_symlink operation creates
a symbolic link to a pathname or an external name. A file that is
named Link_name, of type "symbolic link", is created within the
directory that is represented by Token_structure. The content of the
symbolic link file is the path name or external name that is specified
in Pathname.
Input parameter formatvn_symlink (Token_structure,
OSI_structure,
Audit_structure,
Pathname_length,
Pathname,
attribute_structure,
Link_name_length,
Link_name,
Return_value,
Return_code,
Reason_code)
Parameters- Token_structure
- Supplied parameter
- Type:
- TOKSTR
- Length:
- Specified by TOKSTR.ts_hdr.cblen.
The Token_structure represents the file (vnode)
that is being operated on. It contains the PFS's initialization token,
mount token, and the file token. Refer to LFS/PFS control block structure for
a discussion of this structure, and to the TOKSTR typedef in BPXYPFSI
in Interface structures for C language servers and clients for its mapping.
- OSI_structure
- Supplied and returned parameter
- Type:
- OSI
- Length:
- Specified by OSI.osi_hdr.cblen.
The OSI_structure contains information that is used
by the OSI operations that may be called by the PFS. See OSI services for more information.
It also contains
MVS-specific information that needs to be passed to the PFS, including
SMF accounting fields, a work area, a recovery area, and an optional
pointer to an output ATTR structure. For more details on the OSI structure,
see The OSI structure.
This area is mapped by
the OSI typedef in BPXYPFSI in Interface structures for C language servers and clients.
- Audit_structure
- Supplied parameter
- Type:
- CRED
- Length:
- Specified by CRED.cred_hdr.cblen.
The Audit_structure contains information that is
used by the security product for access checks and auditing. It is
passed to most SAF routines that are invoked by the PFS.
Refer
to Security responsibilities and considerations for a discussion of security processing,
and to the CRED typedef in BPXYPFSI in Interface structures for C language servers and clients for
the mapping of this structure.
- Pathname_length
- Supplied parameter
- Type:
- Integer
- Length:
- Fullword
A fullword that contains the length of Pathname.
The Pathname can be up to 1023 bytes long.
- Pathname
- Supplied parameter
- Type:
- Character string
- Length:
- Specified by the Pathname_length parameter
An area that contains the pathname or external name
for which a symbolic link is to be created.
A pathname can
begin with or without a slash: - If the pathname begins with a slash, it is an absolute pathname;
the slash refers to the root directory, and the search for the file
starts at the root directory.
- If the pathname does not begin with a slash, it is a relative pathname,
and the search for the file starts at the parent directory of the
symbolic link file.
A pathname contains no nulls.
An external name
is the name of an object outside of the hierarchical file system.
It may contain nulls.
- attribute_structure
- Supplied parameter
- Type:
- ATTR
- Length:
- Specified by ATTR.at_hdr.cblen.
An area that contains the file attributes that
are to be set for the symbolic link being created. This area is mapped
by typedef ATTR in the BPXYVFSI header file (see Interface structures for C language servers and clients).
- Link_name_length
- Supplied parameter
- Type:
- Integer
- Length:
- Fullword
A fullword that contains the length of Link_name.
The Link_name can be up to 255 bytes long.
- Link_name
- Supplied parameter
- Type:
- Character string
- Length:
- Specified by Link_name_length parameter
An area that contains the symbolic link that is
being created. Link_name contains no nulls.
- Return_value
- Returned parameter
- Type:
- Integer
- Length:
- Fullword
A fullword in which the vn_symlink service returns
the results of the operation, as one of the following: - Return_value
- Meaning
- -1
- The operation was not successful. The Return_code and Reason_Code
values must be filled in by the PFS when Return_value is -1.
- 0
- The operation was successful.
- Return_code
- Returned parameter
- Type:
- Integer
- Length:
- Fullword
A fullword in which the vn_symlink service stores
the return code. The vn_symlink service returns Return_code only if
Return_value is -1. See z/OS UNIX System Services Messages and Codes for
a complete list of supported return code values.
The vn_symlink service should support at least the
following error values: Return_code |
Explanation |
---|
EACCES |
The calling process does not have permission to write in
the directory that was specified. |
EEXIST |
Link_name already exists. |
ENAMETOOLONG |
Link_name is longer than is supported by the PFS. |
ENOENT |
The parent directory has been marked for deletion. |
ENOSPC |
The file system is out of space. |
ENOSYS |
The PFS does not support storing external links. |
EROFS |
Token_structure specifies a directory on a read-only file
system. |
- Reason_code
- Returned parameter
- Type:
- Integer
- Length:
- Fullword
A fullword in which the vn_symlink service stores
the reason code. The vn_symlink service returns Reason_code only
if Return_value is -1. Reason_code further qualifies
the Return_code value. These reason codes are documented by the PFS.
Implementation notes- Overview of vn_symlink processing
- Creating files provides an overview of symbolic
link creation.
- Specific processing notes
- Serialization provided by the LFS
- The vn_symlink operation is invoked with an exclusive latch held
on the vnode of the directory.
- Security calls to be made by the PFS
- The PFS is expected to invoke SAF's Check Access callable service
to check that the user has write permission to the directory.
|