function closeSync( fd ) {
	if ( !isNonNegativeInteger( fd ) ) {
		throw new TypeError( format( 'invalid argument. Must provide a valid file descriptor (i.e., a nonnegative integer). Value: `%s`.', fd ) );
	}
	try {
		close( fd );
	} catch ( err ) {
		return err;
	}
}
Synchronously closes a file descriptor.

@param {NonNegativeInteger} fd - file descriptor
@throws {TypeError} must provide a valid file descriptor (nonnegative integer)
@returns {(Error|void)} an error object or `undefined`

@example
var openSync = require( '@stdlib/fs/open' ).sync;

var fd = openSync( __filename, 'r+' );

if ( fd instanceof Error ) {
    throw fd;
}

var err = closeSync( fd );
if ( err instanceof Error ) {
    throw err;
}