Generated by Cython 0.24

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: extattr.c

     001: #-

     002: # Copyright (c) 2015 iXsystems, Inc.

     003: # All rights reserved.

     004: #

     005: # Redistribution and use in source and binary forms, with or without

     006: # modification, are permitted provided that the following conditions

     007: # are met:

     008: # 1. Redistributions of source code must retain the above copyright

     009: #    notice, this list of conditions and the following disclaimer.

     010: # 2. Redistributions in binary form must reproduce the above copyright

     011: #    notice, this list of conditions and the following disclaimer in the

     012: #    documentation and/or other materials provided with the distribution.

     013: #

     014: # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND

     015: # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

     016: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

     017: # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE

     018: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL

     019: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS

     020: # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)

     021: # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT

     022: # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY

     023: # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF

     024: # SUCH DAMAGE.

     025: #

     026:

    +027: import os

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +028: import enum

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     029: import cython

    +030: import pwd

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_pwd, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pwd, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +031: import grp

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_grp, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_grp, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +032: import six

      __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     033: from libc.string cimport memcpy

     034: from libc.errno cimport errno

     035: from libc.stdlib cimport malloc, free

     036: cimport defs

     037:

     038: IF PY2:

    +039:     file_types = (file, )

      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_builtin_file);
      __Pyx_GIVEREF(__pyx_builtin_file);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_file);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_types, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     040: ELSE:

     041:     import io

     042:     file_types = (io.IOBase, )

     043:

    +044: class Namespaces(enum.IntEnum):

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Namespaces, __pyx_n_s_Namespaces, (PyObject *) NULL, __pyx_n_s_bsd_extattr, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    /* … */
      __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Namespaces, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Namespaces, __pyx_t_4) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +045:     USER = defs.EXTATTR_NAMESPACE_USER

      __pyx_t_4 = __Pyx_PyInt_From_int(EXTATTR_NAMESPACE_USER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_USER, __pyx_t_4) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +046:     SYSTEM = defs.EXTATTR_NAMESPACE_SYSTEM

      __pyx_t_4 = __Pyx_PyInt_From_int(EXTATTR_NAMESPACE_SYSTEM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_SYSTEM, __pyx_t_4) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     047:

     048: _namespace_mapping = {

    +049:     "user" : Namespaces.USER,

      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Namespaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_USER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_user, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +050:     "system" : Namespaces.SYSTEM,

      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Namespaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SYSTEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_system, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_namespace_mapping, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     051: }

     052:

    +053: def get_namespace(*args):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7extattr_1get_namespace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_3bsd_7extattr_get_namespace[] = "Namespace mapper for extattr(3) APIs.\n    :Parameters:\n    \t- None - return a dictionary of all namespaces (str -> Namespaces value)\n\t- str list - return a list (including possibly only one element) of\n\t\tthe requested namespaces, as above\n    :Raises:\n\tValueError : If a namespace is given, but does not exists.\n\n    :Returns:\n\tA dictionary of namespace strings to value.\n    ";
    static PyMethodDef __pyx_mdef_3bsd_7extattr_1get_namespace = {"get_namespace", (PyCFunction)__pyx_pw_3bsd_7extattr_1get_namespace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3bsd_7extattr_get_namespace};
    static PyObject *__pyx_pw_3bsd_7extattr_1get_namespace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_args = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get_namespace (wrapper)", 0);
      if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_namespace", 0))) return NULL;
      __Pyx_INCREF(__pyx_args);
      __pyx_v_args = __pyx_args;
      __pyx_r = __pyx_pf_3bsd_7extattr_get_namespace(__pyx_self, __pyx_v_args);

      /* function exit code */
      __Pyx_XDECREF(__pyx_v_args);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7extattr_get_namespace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) {
      PyObject *__pyx_v_retval = NULL;
      PyObject *__pyx_v_n = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get_namespace", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("bsd.extattr.get_namespace", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_retval);
      __Pyx_XDECREF(__pyx_v_n);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_args, __pyx_n_s_retval, __pyx_n_s_n); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__9);
      __Pyx_GIVEREF(__pyx_tuple__9);
    /* … */
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3bsd_7extattr_1get_namespace, NULL, __pyx_n_s_bsd_extattr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_namespace, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_nas_source_py_bsd_bsd_extat, __pyx_n_s_get_namespace, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 53, __pyx_L1_error)

     054:     """Namespace mapper for extattr(3) APIs.

     055:     :Parameters:

     056:     	- None - return a dictionary of all namespaces (str -> Namespaces value)

     057: 	- str list - return a list (including possibly only one element) of

     058: 		the requested namespaces, as above

     059:     :Raises:

     060: 	ValueError : If a namespace is given, but does not exists.

     061:

     062:     :Returns:

     063: 	A dictionary of namespace strings to value.

     064:     """

    +065:     if len(args) == 0:

      __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 65, __pyx_L1_error)
      __pyx_t_2 = ((__pyx_t_1 == 0) != 0);
      if (__pyx_t_2) {
    /* … */
      }

    +066:         return _namespace_mapping.copy()

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_namespace_mapping); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 66, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (__pyx_t_4) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error)
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;

     067:     else:

    +068:         retval = {}

      /*else*/ {
        __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_v_retval = ((PyObject*)__pyx_t_3);
        __pyx_t_3 = 0;

    +069:         for n in args:

        __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
        for (;;) {
          if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 69, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
          __pyx_t_5 = 0;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +070:             if n not in _namespace_mapping:

          __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_namespace_mapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_n, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 70, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_6 = (__pyx_t_2 != 0);
          if (__pyx_t_6) {
    /* … */
          }

    +071:                 raise ValueError("%s is not a valid extattr namespace" % n)

            __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_is_not_a_valid_extattr_namesp, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_Raise(__pyx_t_5, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __PYX_ERR(0, 71, __pyx_L1_error)

    +072:             retval[n] = _namespace_mapping[n]

          __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_namespace_mapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(PyDict_SetItem(__pyx_v_retval, __pyx_v_n, __pyx_t_4) < 0)) __PYX_ERR(0, 72, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +073:         return retval

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_retval);
        __pyx_r = __pyx_v_retval;
        goto __pyx_L0;
      }

     074:

    +075: def get(fobj, namespace = Namespaces.USER, attrname = None, follow = True):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7extattr_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_3bsd_7extattr_2get[] = "Wrapper for extattr_get(3) API.\n\n    :Parameters:\n\t- fobj (file, str, int):  the file object upon which to operate.\n\t\tIf a string, this is the path; if a file, the file object\n\t\ton which to operate; if an integer, the file descriptor.\n\t- namespace (int):  The namespace to use.  Currently, either\n\t\textattr.Namespaces.USER or extattr.Namespaces.SYSTEM\n    \t\t(defaults to extattr.Namespaces.USER).\n\t- attrname (str):  the extended attribute to get.  If None, it\n\t\twill return all extended attributes for the given\n\t\tfile and namespace.\n    \t- follow (bool):  If the file is a pathname, and is a symbolic link,\n\t\tfollow (or do not follow) the link.  Default is to not follow.\n\n    :Raises:\n\tOSError:  the corresponding extattr_get system call failed.\n\tMemoryError:  ran out of memory.\n\tValueError:  a parameter had a bad value.\n\n    :Returns:\n\tA dictionary mapping the name to value.\n    ";
    static PyMethodDef __pyx_mdef_3bsd_7extattr_3get = {"get", (PyCFunction)__pyx_pw_3bsd_7extattr_3get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3bsd_7extattr_2get};
    static PyObject *__pyx_pw_3bsd_7extattr_3get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_fobj = 0;
      PyObject *__pyx_v_namespace = 0;
      PyObject *__pyx_v_attrname = 0;
      PyObject *__pyx_v_follow = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fobj,&__pyx_n_s_namespace,&__pyx_n_s_attrname,&__pyx_n_s_follow,0};
        PyObject* values[4] = {0,0,0,0};
        values[1] = __pyx_k_;
        values[2] = ((PyObject *)Py_None);
        values[3] = ((PyObject *)Py_True);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fobj)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namespace);
              if (value) { values[1] = value; kw_args--; }
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attrname);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 75, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_fobj = values[0];
        __pyx_v_namespace = values[1];
        __pyx_v_attrname = values[2];
        __pyx_v_follow = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("get", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 75, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("bsd.extattr.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_3bsd_7extattr_2get(__pyx_self, __pyx_v_fobj, __pyx_v_namespace, __pyx_v_attrname, __pyx_v_follow);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7extattr_2get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fobj, PyObject *__pyx_v_namespace, PyObject *__pyx_v_attrname, PyObject *__pyx_v_follow) {
      char *__pyx_v_ea_name;
      char *__pyx_v_data_buffer;
      size_t __pyx_v_nbytes;
      PyObject *__pyx_v_attrs = NULL;
      PyObject *__pyx_v_retval = NULL;
      PyObject *__pyx_v_ea = NULL;
      Py_ssize_t __pyx_v_kr;
      PyObject *__pyx_v_pname = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_AddTraceback("bsd.extattr.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_attrs);
      __Pyx_XDECREF(__pyx_v_retval);
      __Pyx_XDECREF(__pyx_v_ea);
      __Pyx_XDECREF(__pyx_v_pname);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Namespaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_USER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_k_ = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_tuple__11 = PyTuple_Pack(13, __pyx_n_s_fobj, __pyx_n_s_namespace, __pyx_n_s_attrname, __pyx_n_s_follow, __pyx_n_s_ns_pointer, __pyx_n_s_ea_name, __pyx_n_s_data_buffer, __pyx_n_s_nbytes, __pyx_n_s_attrs, __pyx_n_s_retval, __pyx_n_s_ea, __pyx_n_s_kr, __pyx_n_s_pname); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__11);
      __Pyx_GIVEREF(__pyx_tuple__11);
      __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3bsd_7extattr_3get, NULL, __pyx_n_s_bsd_extattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_nas_source_py_bsd_bsd_extat, __pyx_n_s_get, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 75, __pyx_L1_error)

     076:     """Wrapper for extattr_get(3) API.

     077:

     078:     :Parameters:

     079: 	- fobj (file, str, int):  the file object upon which to operate.

     080: 		If a string, this is the path; if a file, the file object

     081: 		on which to operate; if an integer, the file descriptor.

     082: 	- namespace (int):  The namespace to use.  Currently, either

     083: 		extattr.Namespaces.USER or extattr.Namespaces.SYSTEM

     084:     		(defaults to extattr.Namespaces.USER).

     085: 	- attrname (str):  the extended attribute to get.  If None, it

     086: 		will return all extended attributes for the given

     087: 		file and namespace.

     088:     	- follow (bool):  If the file is a pathname, and is a symbolic link,

     089: 		follow (or do not follow) the link.  Default is to not follow.

     090:

     091:     :Raises:

     092: 	OSError:  the corresponding extattr_get system call failed.

     093: 	MemoryError:  ran out of memory.

     094: 	ValueError:  a parameter had a bad value.

     095:

     096:     :Returns:

     097: 	A dictionary mapping the name to value.

     098:     """

     099:     cdef:

     100:         char *ns_pointer

     101:         char *ea_name

     102:         char *data_buffer

     103:         size_t nbytes

     104:

    +105:     if attrname is None:

      __pyx_t_1 = (__pyx_v_attrname == Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {
    /* … */
        goto __pyx_L3;
      }

    +106:         attrs = _list(fobj, namespace, follow)

        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 106, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fobj);
        __Pyx_GIVEREF(__pyx_v_fobj);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_fobj);
        __Pyx_INCREF(__pyx_v_namespace);
        __Pyx_GIVEREF(__pyx_v_namespace);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_namespace);
        __Pyx_INCREF(__pyx_v_follow);
        __Pyx_GIVEREF(__pyx_v_follow);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_follow);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_attrs = __pyx_t_3;
        __pyx_t_3 = 0;

     107:     else:

    +108:         attrs = [attrname]

      /*else*/ {
        __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_attrname);
        __Pyx_GIVEREF(__pyx_v_attrname);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_attrname);
        __pyx_v_attrs = __pyx_t_3;
        __pyx_t_3 = 0;
      }
      __pyx_L3:;

    +109:     retval = {}

      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_retval = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

     110:

    +111:     for ea in attrs:

      if (likely(PyList_CheckExact(__pyx_v_attrs)) || PyTuple_CheckExact(__pyx_v_attrs)) {
        __pyx_t_3 = __pyx_v_attrs; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attrs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 111, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_3);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 111, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_ea, __pyx_t_4);
        __pyx_t_4 = 0;
    /* … */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +112:         ea_name = ea

        __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_ea); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
        __pyx_v_ea_name = __pyx_t_9;

    +113:         try:

        /*try:*/ {

    +114:             if isinstance(fobj, file_types):

          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyObject_IsInstance(__pyx_v_fobj, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 114, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_1 = (__pyx_t_2 != 0);
          if (__pyx_t_1) {
    /* … */
            goto __pyx_L11;
          }

    +115:                 kr = defs.extattr_get_fd(fobj.fileno(), namespace, ea_name, NULL, 0)

            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_fobj, __pyx_n_s_fileno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_5 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_7, function);
              }
            }
            if (__pyx_t_5) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L9_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            } else {
              __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L9_error)
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L9_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L9_error)
            __pyx_v_kr = extattr_get_fd(__pyx_t_10, __pyx_t_11, __pyx_v_ea_name, NULL, 0);

    +116:             elif type(fobj) is int:

          __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyInt_Type)));
          __pyx_t_2 = (__pyx_t_1 != 0);
          if (__pyx_t_2) {
    /* … */
            goto __pyx_L11;
          }

    +117:                 kr = defs.extattr_get_fd(fobj, namespace, ea_name, NULL, 0)

            __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_fobj); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L9_error)
            __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L9_error)
            __pyx_v_kr = extattr_get_fd(__pyx_t_11, __pyx_t_10, __pyx_v_ea_name, NULL, 0);

    +118:             elif type(fobj) is str:

          __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyString_Type)));
          __pyx_t_1 = (__pyx_t_2 != 0);
          if (__pyx_t_1) {
    /* … */
            goto __pyx_L11;
          }

    +119:                 pname = fobj

            __Pyx_INCREF(__pyx_v_fobj);
            __Pyx_XDECREF_SET(__pyx_v_pname, __pyx_v_fobj);

    +120:                 if follow:

            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_follow); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 120, __pyx_L9_error)
            if (__pyx_t_1) {
    /* … */
              goto __pyx_L12;
            }

    +121:                     kr = defs.extattr_get_file(pname, namespace, ea_name, NULL, 0)

              __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_pname); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L9_error)
              __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L9_error)
              __pyx_v_kr = extattr_get_file(__pyx_t_12, __pyx_t_10, __pyx_v_ea_name, NULL, 0);

     122:                 else:

    +123:                     kr = defs.extattr_get_link(pname, namespace, ea_name, NULL, 0)

            /*else*/ {
              __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_pname); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L9_error)
              __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L9_error)
              __pyx_v_kr = extattr_get_link(__pyx_t_13, __pyx_t_10, __pyx_v_ea_name, NULL, 0);
            }
            __pyx_L12:;

     124:             else:

    +125:                 raise ValueError("Unknown file type")

          /*else*/ {
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_Raise(__pyx_t_4, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __PYX_ERR(0, 125, __pyx_L9_error)
          }
          __pyx_L11:;
    /* … */
      __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Unknown_file_type); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__2);
      __Pyx_GIVEREF(__pyx_tuple__2);

     126:

    +127:             if kr == -1:

          __pyx_t_1 = ((__pyx_v_kr == -1L) != 0);
          if (__pyx_t_1) {
    /* … */
          }

    +128:                 raise OSError(errno, os.strerror(errno))

            __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 128, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_15 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_14, function);
              }
            }
            if (!__pyx_t_15) {
              __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L9_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_GOTREF(__pyx_t_7);
            } else {
              __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 128, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
              __Pyx_GIVEREF(__pyx_t_5);
              PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_5);
              __pyx_t_5 = 0;
              __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            }
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 128, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7);
            __pyx_t_4 = 0;
            __pyx_t_7 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_Raise(__pyx_t_7, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __PYX_ERR(0, 128, __pyx_L9_error)

    +129:             if kr > 0:

          __pyx_t_1 = ((__pyx_v_kr > 0) != 0);
          if (__pyx_t_1) {
    /* … */
          }
        }

    +130:                 nbytes = kr

            __pyx_v_nbytes = __pyx_v_kr;

    +131:                 data_buffer = <char*>malloc(nbytes)

            __pyx_v_data_buffer = ((char *)malloc(__pyx_v_nbytes));

    +132:                 if not data_buffer:

            __pyx_t_1 = ((!(__pyx_v_data_buffer != 0)) != 0);
            if (__pyx_t_1) {
    /* … */
            }

    +133:                     raise MemoryError()

              PyErr_NoMemory(); __PYX_ERR(0, 133, __pyx_L9_error)

     134:

    +135:                 if isinstance(fobj, file_types):

            __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_1 = PyObject_IsInstance(__pyx_v_fobj, __pyx_t_7); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 135, __pyx_L9_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_2 = (__pyx_t_1 != 0);
            if (__pyx_t_2) {
    /* … */
              goto __pyx_L16;
            }

    +136:                     kr = defs.extattr_get_fd(fobj.fileno(), namespace, ea_name, data_buffer, nbytes)

              __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_fobj, __pyx_n_s_fileno); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 136, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_4 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_14, function);
                }
              }
              if (__pyx_t_4) {
                __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L9_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              } else {
                __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L9_error)
              }
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L9_error)
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L9_error)
              __pyx_v_kr = extattr_get_fd(__pyx_t_10, __pyx_t_11, __pyx_v_ea_name, __pyx_v_data_buffer, __pyx_v_nbytes);

    +137:                 elif type(fobj) is int:

            __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyInt_Type)));
            __pyx_t_1 = (__pyx_t_2 != 0);
            if (__pyx_t_1) {
    /* … */
              goto __pyx_L16;
            }

    +138:                     kr = defs.extattr_get_fd(fobj, namespace, ea_name, data_buffer, nbytes)

              __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_fobj); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L9_error)
              __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L9_error)
              __pyx_v_kr = extattr_get_fd(__pyx_t_11, __pyx_t_10, __pyx_v_ea_name, __pyx_v_data_buffer, __pyx_v_nbytes);

    +139:                 elif type(fobj) is str:

            __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyString_Type)));
            __pyx_t_2 = (__pyx_t_1 != 0);
            if (__pyx_t_2) {
    /* … */
            }
            __pyx_L16:;

    +140:                     if follow:

              __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_follow); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 140, __pyx_L9_error)
              if (__pyx_t_2) {
    /* … */
                goto __pyx_L17;
              }

    +141:                         kr = defs.extattr_get_file(pname, namespace, ea_name, data_buffer, nbytes)

                if (unlikely(!__pyx_v_pname)) { __Pyx_RaiseUnboundLocalError("pname"); __PYX_ERR(0, 141, __pyx_L9_error) }
                __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_pname); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L9_error)
                __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L9_error)
                __pyx_v_kr = extattr_get_file(__pyx_t_12, __pyx_t_10, __pyx_v_ea_name, __pyx_v_data_buffer, __pyx_v_nbytes);

     142:                     else:

    +143:                         kr = defs.extattr_get_link(pname, namespace, ea_name, data_buffer, nbytes)

              /*else*/ {
                if (unlikely(!__pyx_v_pname)) { __Pyx_RaiseUnboundLocalError("pname"); __PYX_ERR(0, 143, __pyx_L9_error) }
                __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_pname); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L9_error)
                __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L9_error)
                __pyx_v_kr = extattr_get_link(__pyx_t_13, __pyx_t_10, __pyx_v_ea_name, __pyx_v_data_buffer, __pyx_v_nbytes);
              }
              __pyx_L17:;

     144:                 # No need to check for another type, because the first pass would have caught it

    +145:                 if kr == -1:

            __pyx_t_2 = ((__pyx_v_kr == -1L) != 0);
            if (__pyx_t_2) {
    /* … */
            }

    +146:                     raise OSError(errno, os.strerror(errno))

              __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 146, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_5 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_16))) {
                __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16);
                if (likely(__pyx_t_5)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
                  __Pyx_INCREF(__pyx_t_5);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_16, function);
                }
              }
              if (!__pyx_t_5) {
                __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 146, __pyx_L9_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_GOTREF(__pyx_t_14);
              } else {
                __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 146, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_15);
                __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); __pyx_t_5 = NULL;
                __Pyx_GIVEREF(__pyx_t_4);
                PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_4);
                __pyx_t_4 = 0;
                __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_15, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 146, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              }
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 146, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_GIVEREF(__pyx_t_7);
              PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_7);
              __Pyx_GIVEREF(__pyx_t_14);
              PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_14);
              __pyx_t_7 = 0;
              __pyx_t_14 = 0;
              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_16, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 146, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_Raise(__pyx_t_14, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __PYX_ERR(0, 146, __pyx_L9_error)

     147:                 # Now, data_buffer contains the EA value.

     148:                 # This may be binary data, or it may be a string.

     149:                 # So let's try converting it to a utf-8 string.

    +150:                 try:

            {
              /*try:*/ {
    /* … */
              }
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              goto __pyx_L26_try_end;
              __pyx_L19_error:;
              __Pyx_PyThreadState_assign
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    /* … */
              __Pyx_PyThreadState_assign
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
              goto __pyx_L9_error;
              __pyx_L20_exception_handled:;
              __Pyx_PyThreadState_assign
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
              __pyx_L26_try_end:;
            }

    +151:                     retval[ea] = str(data_buffer[:nbytes], "utf-8")

                __pyx_t_14 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_data_buffer + 0, __pyx_v_nbytes - 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 151, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_14);
                __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 151, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_GIVEREF(__pyx_t_14);
                PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14);
                __Pyx_INCREF(__pyx_kp_s_utf_8);
                __Pyx_GIVEREF(__pyx_kp_s_utf_8);
                PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_kp_s_utf_8);
                __pyx_t_14 = 0;
                __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_16, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 151, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                if (unlikely(PyDict_SetItem(__pyx_v_retval, __pyx_v_ea, __pyx_t_14) < 0)) __PYX_ERR(0, 151, __pyx_L19_error)
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    +152:                 except:

              /*except:*/ {
                __Pyx_AddTraceback("bsd.extattr.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_16, &__pyx_t_7) < 0) __PYX_ERR(0, 152, __pyx_L21_except_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_GOTREF(__pyx_t_16);
                __Pyx_GOTREF(__pyx_t_7);

    +153:                     retval[ea] = bytes(data_buffer[:nbytes])

                __pyx_t_15 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_data_buffer + 0, __pyx_v_nbytes - 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 153, __pyx_L21_except_error)
                __Pyx_GOTREF(__pyx_t_15);
                __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L21_except_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_15);
                PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_15);
                __pyx_t_15 = 0;
                __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 153, __pyx_L21_except_error)
                __Pyx_GOTREF(__pyx_t_15);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(PyDict_SetItem(__pyx_v_retval, __pyx_v_ea, __pyx_t_15) < 0)) __PYX_ERR(0, 153, __pyx_L21_except_error)
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                goto __pyx_L20_exception_handled;
              }
              __pyx_L21_except_error:;

    +154:                 free(data_buffer)

            free(__pyx_v_data_buffer);

    +155:                 data_buffer = NULL

            __pyx_v_data_buffer = NULL;

     156:

     157:         finally:

    +158:             if data_buffer:

        /*finally:*/ {
          /*normal exit:*/{
            __pyx_t_2 = (__pyx_v_data_buffer != 0);
            if (__pyx_t_2) {
    /* … */
            }
            goto __pyx_L10;
          }
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __pyx_L9_error:;
            __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __Pyx_PyThreadState_assign
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
            {
              __pyx_t_2 = (__pyx_v_data_buffer != 0);
              if (__pyx_t_2) {
    /* … */
              }
            }
            __Pyx_PyThreadState_assign
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ErrRestore(__pyx_t_19, __pyx_t_18, __pyx_t_17);
            __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_20;
            goto __pyx_L1_error;
          }
          __pyx_L10:;
        }

    +159:                 free(data_buffer)

              free(__pyx_v_data_buffer);
    /* … */
                free(__pyx_v_data_buffer);

     160:

    +161:     return retval

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_retval);
      __pyx_r = __pyx_v_retval;
      goto __pyx_L0;

     162:

    +163: def delete(fobj, namespace = Namespaces.USER, attrname = None, follow = True):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7extattr_5delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_3bsd_7extattr_4delete[] = "Wrapper for extattr_delete(3) API.\n\n    :Parameters:\n\t- fobj (file, str, int):  the file object upon which to operate.\n\t\tIf a string, this is the path; if a file, the file object\n\t\ton which to operate; if an integer, the file descriptor.\n\t- namespace (int):  The namespace to use.  Currently, either\n\t\textattr.Namespaces.USER or extattr.Namespaces.SYSTEM\n    \t\t(defaults to extattr.Namespaces.USER).\n\t- attrname (str):  the extended attribute to delete.  If None, it\n\t\twill delete all extended attributes for the given\n\t\tfile and namespace.\n    \t- follow (bool):  If the file is a pathname, and is a symbolic link,\n\t\tfollow (or do not follow) the link.  Default is to not follow.\n\n    :Raises:\n\tOSError:  the corresponding extattr_get system call failed.\n        ValueError:  One of the parameters had a bad value\n        MemoryError:  Out of memory\n\n    :Returns:\n        True if it succeeds.  (An error is raised otherwise.)\n    ";
    static PyMethodDef __pyx_mdef_3bsd_7extattr_5delete = {"delete", (PyCFunction)__pyx_pw_3bsd_7extattr_5delete, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3bsd_7extattr_4delete};
    static PyObject *__pyx_pw_3bsd_7extattr_5delete(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_fobj = 0;
      PyObject *__pyx_v_namespace = 0;
      PyObject *__pyx_v_attrname = 0;
      PyObject *__pyx_v_follow = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("delete (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fobj,&__pyx_n_s_namespace,&__pyx_n_s_attrname,&__pyx_n_s_follow,0};
        PyObject* values[4] = {0,0,0,0};
        values[1] = __pyx_k__3;
        values[2] = ((PyObject *)Py_None);
        values[3] = ((PyObject *)Py_True);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fobj)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namespace);
              if (value) { values[1] = value; kw_args--; }
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attrname);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete") < 0)) __PYX_ERR(0, 163, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_fobj = values[0];
        __pyx_v_namespace = values[1];
        __pyx_v_attrname = values[2];
        __pyx_v_follow = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("delete", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 163, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("bsd.extattr.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_3bsd_7extattr_4delete(__pyx_self, __pyx_v_fobj, __pyx_v_namespace, __pyx_v_attrname, __pyx_v_follow);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7extattr_4delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fobj, PyObject *__pyx_v_namespace, PyObject *__pyx_v_attrname, PyObject *__pyx_v_follow) {
      char *__pyx_v_ea_name;
      PyObject *__pyx_v_attrs = NULL;
      CYTHON_UNUSED PyObject *__pyx_v_retval = NULL;
      PyObject *__pyx_v_ea = NULL;
      Py_ssize_t __pyx_v_kr;
      PyObject *__pyx_v_pname = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("delete", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_AddTraceback("bsd.extattr.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_attrs);
      __Pyx_XDECREF(__pyx_v_retval);
      __Pyx_XDECREF(__pyx_v_ea);
      __Pyx_XDECREF(__pyx_v_pname);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Namespaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_USER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_k__3 = __pyx_t_1;
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__13 = PyTuple_Pack(10, __pyx_n_s_fobj, __pyx_n_s_namespace, __pyx_n_s_attrname, __pyx_n_s_follow, __pyx_n_s_ea_name, __pyx_n_s_attrs, __pyx_n_s_retval, __pyx_n_s_ea, __pyx_n_s_kr, __pyx_n_s_pname); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__13);
      __Pyx_GIVEREF(__pyx_tuple__13);
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3bsd_7extattr_5delete, NULL, __pyx_n_s_bsd_extattr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_delete, __pyx_t_1) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_nas_source_py_bsd_bsd_extat, __pyx_n_s_delete, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 163, __pyx_L1_error)

     164:     """Wrapper for extattr_delete(3) API.

     165:

     166:     :Parameters:

     167: 	- fobj (file, str, int):  the file object upon which to operate.

     168: 		If a string, this is the path; if a file, the file object

     169: 		on which to operate; if an integer, the file descriptor.

     170: 	- namespace (int):  The namespace to use.  Currently, either

     171: 		extattr.Namespaces.USER or extattr.Namespaces.SYSTEM

     172:     		(defaults to extattr.Namespaces.USER).

     173: 	- attrname (str):  the extended attribute to delete.  If None, it

     174: 		will delete all extended attributes for the given

     175: 		file and namespace.

     176:     	- follow (bool):  If the file is a pathname, and is a symbolic link,

     177: 		follow (or do not follow) the link.  Default is to not follow.

     178:

     179:     :Raises:

     180: 	OSError:  the corresponding extattr_get system call failed.

     181:         ValueError:  One of the parameters had a bad value

     182:         MemoryError:  Out of memory

     183:

     184:     :Returns:

     185:         True if it succeeds.  (An error is raised otherwise.)

     186:     """

     187:     cdef:

     188:         char *ea_name

     189:

    +190:     if attrname is None:

      __pyx_t_1 = (__pyx_v_attrname == Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {
    /* … */
        goto __pyx_L3;
      }

    +191:         attrs = _list(fobj, namespace, follow)

        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_fobj);
        __Pyx_GIVEREF(__pyx_v_fobj);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_fobj);
        __Pyx_INCREF(__pyx_v_namespace);
        __Pyx_GIVEREF(__pyx_v_namespace);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_namespace);
        __Pyx_INCREF(__pyx_v_follow);
        __Pyx_GIVEREF(__pyx_v_follow);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_follow);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_attrs = __pyx_t_3;
        __pyx_t_3 = 0;

     192:     else:

    +193:         attrs = [attrname]

      /*else*/ {
        __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_attrname);
        __Pyx_GIVEREF(__pyx_v_attrname);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_attrname);
        __pyx_v_attrs = __pyx_t_3;
        __pyx_t_3 = 0;
      }
      __pyx_L3:;

    +194:     retval = {}

      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_retval = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

     195:

    +196:     for ea in attrs:

      if (likely(PyList_CheckExact(__pyx_v_attrs)) || PyTuple_CheckExact(__pyx_v_attrs)) {
        __pyx_t_3 = __pyx_v_attrs; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_attrs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_8(__pyx_t_3);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 196, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_ea, __pyx_t_4);
        __pyx_t_4 = 0;
    /* … */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +197:         ea_name = ea

        __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_ea); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L1_error)
        __pyx_v_ea_name = __pyx_t_9;

    +198:         if isinstance(fobj, file_types):

        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_IsInstance(__pyx_v_fobj, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 198, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_1 = (__pyx_t_2 != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L6;
        }

    +199:             kr = defs.extattr_delete_fd(fobj.fileno(), namespace, ea_name)

          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_fobj, __pyx_n_s_fileno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          if (__pyx_t_5) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else {
            __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
          }
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
          __pyx_v_kr = extattr_delete_fd(__pyx_t_10, __pyx_t_11, __pyx_v_ea_name);

    +200:         elif type(fobj) is int:

        __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyInt_Type)));
        __pyx_t_2 = (__pyx_t_1 != 0);
        if (__pyx_t_2) {
    /* … */
          goto __pyx_L6;
        }

    +201:             kr = defs.extattr_delete_fd(fobj, namespace, ea_name)

          __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_fobj); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error)
          __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error)
          __pyx_v_kr = extattr_delete_fd(__pyx_t_11, __pyx_t_10, __pyx_v_ea_name);

    +202:         elif type(fobj) is str:

        __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyString_Type)));
        __pyx_t_1 = (__pyx_t_2 != 0);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L6;
        }

    +203:             pname = fobj

          __Pyx_INCREF(__pyx_v_fobj);
          __Pyx_XDECREF_SET(__pyx_v_pname, __pyx_v_fobj);

    +204:             if follow:

          __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_follow); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
          if (__pyx_t_1) {
    /* … */
            goto __pyx_L7;
          }

    +205:                 kr = defs.extattr_delete_file(pname, namespace, ea_name)

            __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_pname); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
            __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
            __pyx_v_kr = extattr_delete_file(__pyx_t_12, __pyx_t_10, __pyx_v_ea_name);

     206:             else:

    +207:                 kr = defs.extattr_delete_link(pname, namespace, ea_name)

          /*else*/ {
            __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_pname); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
            __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
            __pyx_v_kr = extattr_delete_link(__pyx_t_13, __pyx_t_10, __pyx_v_ea_name);
          }
          __pyx_L7:;

     208:         else:

    +209:             raise ValueError("Unknown file type")

        /*else*/ {
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_Raise(__pyx_t_4, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __PYX_ERR(0, 209, __pyx_L1_error)
        }
        __pyx_L6:;
    /* … */
      __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Unknown_file_type); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__4);
      __Pyx_GIVEREF(__pyx_tuple__4);

     210:

    +211:         if kr == -1:

        __pyx_t_1 = ((__pyx_v_kr == -1L) != 0);
        if (__pyx_t_1) {
    /* … */
        }

    +212:             raise OSError(errno, os.strerror(errno))

          __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_15 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          if (!__pyx_t_15) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_7);
          } else {
            __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 212, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_7);
          PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7);
          __pyx_t_4 = 0;
          __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_Raise(__pyx_t_7, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(0, 212, __pyx_L1_error)

     213:

    +214:     return True

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L0;

     215:

    +216: def set(fobj, namespace = Namespaces.USER, attr = None, follow = True):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7extattr_7set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_3bsd_7extattr_6set[] = "Wrapper for the extattr_set(3) API.\n    \n    :Parameters:\n    \t- fobj (file, str, int):  the file object upon which to operate.\n\t\tIf a string, this is the path; if a file, the file object\n\t\ton which to operate; if an integer, the file descriptor.\n\t- namespace (int):  The namespace to use.  Currently, either\n\t\textattr.Namespaces.USER or extattr.Namespaces.SYSTEM\n    \t\t(default to extattr.Namespaces.USER).\n\t- attr (dict):  The key/value pairs to set.  Currently, the values\n    \t\tmust be strings.\n    \t- follow (bool):  Whether or not to follow symlinks (only valid\n\t\tif fobjs is a string).\n    :Raises:\n\tOSError:  the corresponding extattr_set system call failed.\n    \tValueError:  One of the parameters has an invalid value.\n\tMemoryError:  Out of memory\n\n    :Returns:\n\tTrue if successful.  False if attr was None.  Raises an exception otherwise.\n    ";
    static PyMethodDef __pyx_mdef_3bsd_7extattr_7set = {"set", (PyCFunction)__pyx_pw_3bsd_7extattr_7set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3bsd_7extattr_6set};
    static PyObject *__pyx_pw_3bsd_7extattr_7set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_fobj = 0;
      PyObject *__pyx_v_namespace = 0;
      PyObject *__pyx_v_attr = 0;
      PyObject *__pyx_v_follow = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fobj,&__pyx_n_s_namespace,&__pyx_n_s_attr,&__pyx_n_s_follow,0};
        PyObject* values[4] = {0,0,0,0};
        values[1] = __pyx_k__5;
        values[2] = ((PyObject *)Py_None);
        values[3] = ((PyObject *)Py_True);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fobj)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namespace);
              if (value) { values[1] = value; kw_args--; }
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attr);
              if (value) { values[2] = value; kw_args--; }
            }
            case  3:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow);
              if (value) { values[3] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 216, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_fobj = values[0];
        __pyx_v_namespace = values[1];
        __pyx_v_attr = values[2];
        __pyx_v_follow = values[3];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("set", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 216, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("bsd.extattr.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_3bsd_7extattr_6set(__pyx_self, __pyx_v_fobj, __pyx_v_namespace, __pyx_v_attr, __pyx_v_follow);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7extattr_6set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fobj, PyObject *__pyx_v_namespace, PyObject *__pyx_v_attr, PyObject *__pyx_v_follow) {
      CYTHON_UNUSED char *__pyx_v_pname;
      char *__pyx_v_attr_name;
      char *__pyx_v_attr_data;
      size_t __pyx_v_data_len;
      Py_ssize_t __pyx_v_kr;
      CYTHON_UNUSED void *__pyx_v_data_buffer;
      PyObject *__pyx_v_k = NULL;
      PyObject *__pyx_v_v = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_XDECREF(__pyx_t_20);
      __Pyx_AddTraceback("bsd.extattr.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_k);
      __Pyx_XDECREF(__pyx_v_v);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Namespaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_USER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_k__5 = __pyx_t_2;
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
    /* … */
      __pyx_tuple__15 = PyTuple_Pack(12, __pyx_n_s_fobj, __pyx_n_s_namespace, __pyx_n_s_attr, __pyx_n_s_follow, __pyx_n_s_pname, __pyx_n_s_attr_name, __pyx_n_s_attr_data, __pyx_n_s_data_len, __pyx_n_s_kr, __pyx_n_s_data_buffer, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__15);
      __Pyx_GIVEREF(__pyx_tuple__15);
      __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3bsd_7extattr_7set, NULL, __pyx_n_s_bsd_extattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_nas_source_py_bsd_bsd_extat, __pyx_n_s_set, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 216, __pyx_L1_error)

     217:     """Wrapper for the extattr_set(3) API.

     218:

     219:     :Parameters:

     220:     	- fobj (file, str, int):  the file object upon which to operate.

     221: 		If a string, this is the path; if a file, the file object

     222: 		on which to operate; if an integer, the file descriptor.

     223: 	- namespace (int):  The namespace to use.  Currently, either

     224: 		extattr.Namespaces.USER or extattr.Namespaces.SYSTEM

     225:     		(default to extattr.Namespaces.USER).

     226: 	- attr (dict):  The key/value pairs to set.  Currently, the values

     227:     		must be strings.

     228:     	- follow (bool):  Whether or not to follow symlinks (only valid

     229: 		if fobjs is a string).

     230:     :Raises:

     231: 	OSError:  the corresponding extattr_set system call failed.

     232:     	ValueError:  One of the parameters has an invalid value.

     233: 	MemoryError:  Out of memory

     234:

     235:     :Returns:

     236: 	True if successful.  False if attr was None.  Raises an exception otherwise.

     237:     """

     238:     cdef:

     239:         char *pname

     240:         char *attr_name

     241:         char *attr_data

     242:         size_t data_len

     243:         ssize_t kr

     244:

    +245:     pname = NULL

      __pyx_v_pname = NULL;

    +246:     data_buffer = NULL

      __pyx_v_data_buffer = NULL;

    +247:     data_len = 0

      __pyx_v_data_len = 0;

     248:

    +249:     if not isinstance(fobj, (int, str) + file_types):

      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
      __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyInt_Type)));
      __Pyx_INCREF(((PyObject *)(&PyString_Type)));
      __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
      PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)(&PyString_Type)));
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = PyObject_IsInstance(__pyx_v_fobj, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
      if (__pyx_t_5) {
    /* … */
      }

    +250:         raise ValueError("Invalid type for file object")

        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 250, __pyx_L1_error)
    /* … */
      __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Invalid_type_for_file_object); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__6);
      __Pyx_GIVEREF(__pyx_tuple__6);

     251:

    +252:     if attr is None:

      __pyx_t_5 = (__pyx_v_attr == Py_None);
      __pyx_t_4 = (__pyx_t_5 != 0);
      if (__pyx_t_4) {
    /* … */
      }

    +253:         return False

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        goto __pyx_L0;

     254:

    +255:     for k, v in attr.iteritems():

      __pyx_t_6 = 0;
      if (unlikely(__pyx_v_attr == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
        __PYX_ERR(0, 255, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_attr, 0, __pyx_n_s_iteritems, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_t_2;
      __pyx_t_2 = 0;
      while (1) {
        __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_1, NULL, __pyx_t_8);
        if (unlikely(__pyx_t_9 == 0)) break;
        if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
        __pyx_t_1 = 0;

    +256:         if type(v) is not str:

        __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_v)) != ((PyObject *)(&PyString_Type)));
        __pyx_t_5 = (__pyx_t_4 != 0);
        if (__pyx_t_5) {
    /* … */
        }

    +257:             try:

          {
            /*try:*/ {
    /* … */
            }
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L15_try_end;
            __pyx_L8_error:;
            __Pyx_PyThreadState_assign
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
            __Pyx_PyThreadState_assign
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
            goto __pyx_L1_error;
            __pyx_L15_try_end:;
          }

    +258:                 v = str(v)

              __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_INCREF(__pyx_v_v);
              __Pyx_GIVEREF(__pyx_v_v);
              PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_v);
              __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_2);
              __pyx_t_2 = 0;

    +259:             except:

            /*except:*/ {
              __Pyx_AddTraceback("bsd.extattr.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 259, __pyx_L10_except_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_GOTREF(__pyx_t_13);

    +260:                 raise ValueError("Invalid type for key %s" % k)

              __pyx_t_14 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_type_for_key_s, __pyx_v_k); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 260, __pyx_L10_except_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 260, __pyx_L10_except_error)
              __Pyx_GOTREF(__pyx_t_15);
              __Pyx_GIVEREF(__pyx_t_14);
              PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
              __pyx_t_14 = 0;
              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_15, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 260, __pyx_L10_except_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_Raise(__pyx_t_14, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __PYX_ERR(0, 260, __pyx_L10_except_error)
            }
            __pyx_L10_except_error:;

    +261:         attr_name = k

        __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_v_k); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
        __pyx_v_attr_name = __pyx_t_16;

    +262:         attr_data = v

        __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_v_v); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error)
        __pyx_v_attr_data = __pyx_t_16;

    +263:         data_len = len(v)

        __pyx_t_17 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 263, __pyx_L1_error)
        __pyx_v_data_len = __pyx_t_17;

     264:

    +265:         if isinstance(fobj, file_types):

        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_types); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_5 = PyObject_IsInstance(__pyx_v_fobj, __pyx_t_13); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 265, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_4 = (__pyx_t_5 != 0);
        if (__pyx_t_4) {
    /* … */
          goto __pyx_L18;
        }

    +266:             kr = defs.extattr_set_fd(fobj.fileno(), namespace, attr_name, attr_data, data_len)

          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_defs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_extattr_set_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_fobj, __pyx_n_s_fileno); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          if (__pyx_t_15) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          } else {
            __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyBytes_FromString(__pyx_v_attr_name); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyBytes_FromString(__pyx_v_attr_data); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_18 = __Pyx_PyInt_FromSize_t(__pyx_v_data_len); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_19 = NULL;
          __pyx_t_17 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_19)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_19);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_17 = 1;
            }
          }
          __pyx_t_20 = PyTuple_New(5+__pyx_t_17); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          if (__pyx_t_19) {
            __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_17, __pyx_t_1);
          __Pyx_INCREF(__pyx_v_namespace);
          __Pyx_GIVEREF(__pyx_v_namespace);
          PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_17, __pyx_v_namespace);
          __Pyx_GIVEREF(__pyx_t_14);
          PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_17, __pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_17, __pyx_t_15);
          __Pyx_GIVEREF(__pyx_t_18);
          PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_17, __pyx_t_18);
          __pyx_t_1 = 0;
          __pyx_t_14 = 0;
          __pyx_t_15 = 0;
          __pyx_t_18 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_20, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_21 = PyInt_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_kr = __pyx_t_21;

    +267:         elif type(fobj) is int:

        __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyInt_Type)));
        __pyx_t_5 = (__pyx_t_4 != 0);
        if (__pyx_t_5) {
    /* … */
          goto __pyx_L18;
        }

    +268:             kr = defs.extattr_set_fd(fobj, namespace, attr_name, attr_data, data_len)

          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_defs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_extattr_set_fd); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_attr_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_18 = __Pyx_PyBytes_FromString(__pyx_v_attr_data); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_15 = __Pyx_PyInt_FromSize_t(__pyx_v_data_len); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_14 = NULL;
          __pyx_t_17 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_20))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_20);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_20, function);
              __pyx_t_17 = 1;
            }
          }
          __pyx_t_1 = PyTuple_New(5+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (__pyx_t_14) {
            __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14); __pyx_t_14 = NULL;
          }
          __Pyx_INCREF(__pyx_v_fobj);
          __Pyx_GIVEREF(__pyx_v_fobj);
          PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_17, __pyx_v_fobj);
          __Pyx_INCREF(__pyx_v_namespace);
          __Pyx_GIVEREF(__pyx_v_namespace);
          PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_17, __pyx_v_namespace);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_17, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_18);
          PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_17, __pyx_t_18);
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_1, 4+__pyx_t_17, __pyx_t_15);
          __pyx_t_2 = 0;
          __pyx_t_18 = 0;
          __pyx_t_15 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_1, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_21 = PyInt_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_kr = __pyx_t_21;

    +269:         elif type(fobj) is str:

        __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyString_Type)));
        __pyx_t_4 = (__pyx_t_5 != 0);
        if (__pyx_t_4) {
    /* … */
        }
        __pyx_L18:;

    +270:             if follow:

          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_follow); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 270, __pyx_L1_error)
          if (__pyx_t_4) {
    /* … */
            goto __pyx_L19;
          }

    +271:                 kr = defs.extattr_set_file(fobj, namespace, attr_name, attr_data, data_len)

            __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_v_fobj); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error)
            __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error)
            __pyx_v_kr = extattr_set_file(__pyx_t_22, __pyx_t_9, __pyx_v_attr_name, __pyx_v_attr_data, __pyx_v_data_len);

     272:             else:

    +273:                 kr = defs.extattr_set_link(fobj, namespace, attr_name, attr_data, data_len)

          /*else*/ {
            __pyx_t_23 = __Pyx_PyObject_AsString(__pyx_v_fobj); if (unlikely((!__pyx_t_23) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
            __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
            __pyx_v_kr = extattr_set_link(__pyx_t_23, __pyx_t_9, __pyx_v_attr_name, __pyx_v_attr_data, __pyx_v_data_len);
          }
          __pyx_L19:;

     274:

    +275:         if kr == -1:

        __pyx_t_4 = ((__pyx_v_kr == -1L) != 0);
        if (__pyx_t_4) {
    /* … */
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +276:             raise OSError(errno, os.strerror(errno))

          __pyx_t_13 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strerror); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_18 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_18)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_18);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          if (!__pyx_t_18) {
            __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 276, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_20);
          } else {
            __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_18); __pyx_t_18 = NULL;
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_2, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 276, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_GIVEREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_20);
          PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_20);
          __pyx_t_13 = 0;
          __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_15, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 276, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_Raise(__pyx_t_20, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __PYX_ERR(0, 276, __pyx_L1_error)

     277:

    +278:     return True

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L0;

     279:

    +280: def _list(fobj, namespace = Namespaces.USER, follow = True):

    /* Python wrapper */
    static PyObject *__pyx_pw_3bsd_7extattr_9_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static char __pyx_doc_3bsd_7extattr_8_list[] = "Wrapper for extattr_list(3) API.\n\n    :Parameters:\n\t- fobj (file, str, int):  the file object upon which to operate.\n\t\tIf a string, this is the path; if a file, the file object\n\t\ton which to operate; if an integer, the file descriptor.\n\t- namespace (int):  The namespace to use.  Currently, either\n\t\textattr.Namespaces.USER or extattr.Namespaces.SYSTEM\n    \t\t(defaults to extattr.Namespaces.USER).\n    \t- follow (bool):  If the file is a pathname, and is a symbolic link,\n\t\tfollow (or do not follow) the link.  Default is to not follow.\n\n    :Raises:\n\tOSError:  the corresponding extattr_get system call failed.\n\tValueError:  An invalid namespace was given.\n\tMemoryError:  Out of memory\n\n    :Returns:\n\tA list of attributes for the given file and namespace.\n    ";
    static PyMethodDef __pyx_mdef_3bsd_7extattr_9_list = {"_list", (PyCFunction)__pyx_pw_3bsd_7extattr_9_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3bsd_7extattr_8_list};
    static PyObject *__pyx_pw_3bsd_7extattr_9_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_fobj = 0;
      PyObject *__pyx_v_namespace = 0;
      PyObject *__pyx_v_follow = 0;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_list (wrapper)", 0);
      {
        static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fobj,&__pyx_n_s_namespace,&__pyx_n_s_follow,0};
        PyObject* values[3] = {0,0,0};
        values[1] = __pyx_k__7;
        values[2] = ((PyObject *)Py_True);
        if (unlikely(__pyx_kwds)) {
          Py_ssize_t kw_args;
          const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
          switch (pos_args) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = PyDict_Size(__pyx_kwds);
          switch (pos_args) {
            case  0:
            if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fobj)) != 0)) kw_args--;
            else goto __pyx_L5_argtuple_error;
            case  1:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namespace);
              if (value) { values[1] = value; kw_args--; }
            }
            case  2:
            if (kw_args > 0) {
              PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_follow);
              if (value) { values[2] = value; kw_args--; }
            }
          }
          if (unlikely(kw_args > 0)) {
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_list") < 0)) __PYX_ERR(0, 280, __pyx_L3_error)
          }
        } else {
          switch (PyTuple_GET_SIZE(__pyx_args)) {
            case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
            case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
            case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_fobj = values[0];
        __pyx_v_namespace = values[1];
        __pyx_v_follow = values[2];
      }
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("_list", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 280, __pyx_L3_error)
      __pyx_L3_error:;
      __Pyx_AddTraceback("bsd.extattr._list", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_3bsd_7extattr_8_list(__pyx_self, __pyx_v_fobj, __pyx_v_namespace, __pyx_v_follow);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_3bsd_7extattr_8_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fobj, PyObject *__pyx_v_namespace, PyObject *__pyx_v_follow) {
      char *__pyx_v_pname;
      char *__pyx_v_data_buffer;
      size_t __pyx_v_nbytes;
      Py_ssize_t __pyx_v_kr;
      unsigned char *__pyx_v_ptr;
      PyObject *__pyx_v_retval = NULL;
      PyObject *__pyx_v_eaname_len = NULL;
      PyObject *__pyx_v_eaname = NULL;
      PyObject *__pyx_r = NULL;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_list", 0);
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("bsd.extattr._list", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_retval);
      __Pyx_XDECREF(__pyx_v_eaname_len);
      __Pyx_XDECREF(__pyx_v_eaname);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Namespaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_USER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_k__7 = __pyx_t_1;
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
    /* … */
      __pyx_tuple__17 = PyTuple_Pack(11, __pyx_n_s_fobj, __pyx_n_s_namespace, __pyx_n_s_follow, __pyx_n_s_pname, __pyx_n_s_data_buffer, __pyx_n_s_nbytes, __pyx_n_s_kr, __pyx_n_s_ptr, __pyx_n_s_retval, __pyx_n_s_eaname_len, __pyx_n_s_eaname); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__17);
      __Pyx_GIVEREF(__pyx_tuple__17);
      __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3bsd_7extattr_9_list, NULL, __pyx_n_s_bsd_extattr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_list, __pyx_t_1) < 0) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     281:     """Wrapper for extattr_list(3) API.

     282:

     283:     :Parameters:

     284: 	- fobj (file, str, int):  the file object upon which to operate.

     285: 		If a string, this is the path; if a file, the file object

     286: 		on which to operate; if an integer, the file descriptor.

     287: 	- namespace (int):  The namespace to use.  Currently, either

     288: 		extattr.Namespaces.USER or extattr.Namespaces.SYSTEM

     289:     		(defaults to extattr.Namespaces.USER).

     290:     	- follow (bool):  If the file is a pathname, and is a symbolic link,

     291: 		follow (or do not follow) the link.  Default is to not follow.

     292:

     293:     :Raises:

     294: 	OSError:  the corresponding extattr_get system call failed.

     295: 	ValueError:  An invalid namespace was given.

     296: 	MemoryError:  Out of memory

     297:

     298:     :Returns:

     299: 	A list of attributes for the given file and namespace.

     300:     """

     301:     cdef:

     302:         char *pname

     303:         char *data_buffer

     304:         size_t nbytes

     305:         ssize_t kr

     306:         unsigned char *ptr

     307:

    +308:     retval = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_retval = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +309:     pname = NULL

      __pyx_v_pname = NULL;

    +310:     data_buffer = NULL

      __pyx_v_data_buffer = NULL;

     311:

    +312:     try:

      /*try:*/ {

    +313:         if isinstance(fobj, file_types):

        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyObject_IsInstance(__pyx_v_fobj, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 313, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
    /* … */
          goto __pyx_L6;
        }

    +314:             kr = defs.extattr_list_fd(fobj.fileno(), namespace, data_buffer, 0)

          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fobj, __pyx_n_s_fileno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          if (__pyx_t_5) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L4_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else {
            __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L4_error)
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L4_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L4_error)
          __pyx_v_kr = extattr_list_fd(__pyx_t_6, __pyx_t_7, __pyx_v_data_buffer, 0);

    +315:         elif type(fobj) is int:

        __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyInt_Type)));
        __pyx_t_2 = (__pyx_t_3 != 0);
        if (__pyx_t_2) {
    /* … */
          goto __pyx_L6;
        }

    +316:             kr = defs.extattr_list_fd(fobj, namespace, data_buffer, 0)

          __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_fobj); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L4_error)
          __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 316, __pyx_L4_error)
          __pyx_v_kr = extattr_list_fd(__pyx_t_7, __pyx_t_6, __pyx_v_data_buffer, 0);

    +317:         elif type(fobj) is str:

        __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyString_Type)));
        __pyx_t_3 = (__pyx_t_2 != 0);
        if (__pyx_t_3) {
    /* … */
          goto __pyx_L6;
        }

    +318:             pname = fobj

          __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_fobj); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L4_error)
          __pyx_v_pname = __pyx_t_8;

    +319:             if follow:

          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_follow); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 319, __pyx_L4_error)
          if (__pyx_t_3) {
    /* … */
            goto __pyx_L7;
          }

    +320:                 kr = defs.extattr_list_file(pname, namespace, NULL, 0)

            __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 320, __pyx_L4_error)
            __pyx_v_kr = extattr_list_file(__pyx_v_pname, __pyx_t_6, NULL, 0);

     321:             else:

    +322:                 kr = defs.extattr_list_link(pname, namespace, NULL, 0)

          /*else*/ {
            __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L4_error)
            __pyx_v_kr = extattr_list_link(__pyx_v_pname, __pyx_t_6, NULL, 0);
          }
          __pyx_L7:;

     323:         else:

    +324:             raise ValueError("Unknown file type")

        /*else*/ {
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(0, 324, __pyx_L4_error)
        }
        __pyx_L6:;
    /* … */
      __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Unknown_file_type); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__8);
      __Pyx_GIVEREF(__pyx_tuple__8);

     325:

    +326:         if kr == -1:

        __pyx_t_3 = ((__pyx_v_kr == -1L) != 0);
        if (__pyx_t_3) {
    /* … */
        }

    +327:             raise OSError(errno, os.strerror(errno))

          __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strerror); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
            }
          }
          if (!__pyx_t_10) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L4_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 327, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_1);
          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
          __pyx_t_1 = 0;
          __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_Raise(__pyx_t_4, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __PYX_ERR(0, 327, __pyx_L4_error)

     328:

    +329:         if kr > 0:

        __pyx_t_3 = ((__pyx_v_kr > 0) != 0);
        if (__pyx_t_3) {
    /* … */
        }

    +330:             nbytes = kr

          __pyx_v_nbytes = __pyx_v_kr;

    +331:             data_buffer = <char*>malloc(nbytes)

          __pyx_v_data_buffer = ((char *)malloc(__pyx_v_nbytes));

    +332:             if not data_buffer:

          __pyx_t_3 = ((!(__pyx_v_data_buffer != 0)) != 0);
          if (__pyx_t_3) {
    /* … */
          }

    +333:                 raise MemoryError()

            PyErr_NoMemory(); __PYX_ERR(0, 333, __pyx_L4_error)

     334:

    +335:             if isinstance(fobj, file_types):

          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = PyObject_IsInstance(__pyx_v_fobj, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 335, __pyx_L4_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
    /* … */
            goto __pyx_L11;
          }

    +336:                 kr = defs.extattr_list_file(fobj.fileno(), namespace, data_buffer, nbytes)

            __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_fobj, __pyx_n_s_fileno); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 336, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_9, function);
              }
            }
            if (__pyx_t_1) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L4_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else {
              __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L4_error)
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L4_error)
            __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L4_error)
            __pyx_v_kr = extattr_list_file(__pyx_t_12, __pyx_t_6, __pyx_v_data_buffer, __pyx_v_nbytes);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +337:             elif type(fobj) is int:

          __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyInt_Type)));
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {
    /* … */
            goto __pyx_L11;
          }

    +338:                 kr = defs.exattr_list_file(fobj, namespace, data_buffer, nbytes)

            __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_defs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 338, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exattr_list_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_data_buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 338, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 338, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_5 = NULL;
            __pyx_t_13 = 0;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_13 = 1;
              }
            }
            __pyx_t_10 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 338, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_10);
            if (__pyx_t_5) {
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
            }
            __Pyx_INCREF(__pyx_v_fobj);
            __Pyx_GIVEREF(__pyx_v_fobj);
            PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_13, __pyx_v_fobj);
            __Pyx_INCREF(__pyx_v_namespace);
            __Pyx_GIVEREF(__pyx_v_namespace);
            PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_13, __pyx_v_namespace);
            __Pyx_GIVEREF(__pyx_t_9);
            PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_13, __pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_13, __pyx_t_11);
            __pyx_t_9 = 0;
            __pyx_t_11 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_14 = PyInt_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L4_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_v_kr = __pyx_t_14;

    +339:             elif type(fobj) is str:

          __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_fobj)) == ((PyObject *)(&PyString_Type)));
          __pyx_t_2 = (__pyx_t_3 != 0);
          if (__pyx_t_2) {
    /* … */
          }
          __pyx_L11:;

    +340:                 if follow:

            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_follow); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 340, __pyx_L4_error)
            if (__pyx_t_2) {
    /* … */
              goto __pyx_L12;
            }

    +341:                     kr = defs.extattr_list_file(pname, namespace, data_buffer, nbytes)

              __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 341, __pyx_L4_error)
              __pyx_v_kr = extattr_list_file(__pyx_v_pname, __pyx_t_6, __pyx_v_data_buffer, __pyx_v_nbytes);

     342:                 else:

    +343:                     kr = defs.extattr_list_link(pname, namespace, data_buffer, nbytes)

            /*else*/ {
              __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_namespace); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L4_error)
              __pyx_v_kr = extattr_list_link(__pyx_v_pname, __pyx_t_6, __pyx_v_data_buffer, __pyx_v_nbytes);
            }
            __pyx_L12:;

     344:

    +345:             if kr == -1:

          __pyx_t_2 = ((__pyx_v_kr == -1L) != 0);
          if (__pyx_t_2) {
    /* … */
          }

    +346:                 raise OSError(errno, os.strerror(errno))

            __pyx_t_4 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 346, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strerror); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 346, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 346, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_9 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
              if (likely(__pyx_t_9)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                __Pyx_INCREF(__pyx_t_9);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_11, function);
              }
            }
            if (!__pyx_t_9) {
              __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L4_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_GOTREF(__pyx_t_1);
            } else {
              __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L4_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
              __Pyx_GIVEREF(__pyx_t_10);
              PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_10);
              __pyx_t_10 = 0;
              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L4_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            }
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 346, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_4);
            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
            __pyx_t_4 = 0;
            __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_Raise(__pyx_t_1, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __PYX_ERR(0, 346, __pyx_L4_error)

     347:

     348:             # At this point, data_buffer has the list of names

    +349:             ptr = <unsigned char*>data_buffer

          __pyx_v_ptr = ((unsigned char *)__pyx_v_data_buffer);

    +350:             while ptr < <unsigned char*>(data_buffer + nbytes):

          while (1) {
            __pyx_t_2 = ((__pyx_v_ptr < ((unsigned char *)(__pyx_v_data_buffer + __pyx_v_nbytes))) != 0);
            if (!__pyx_t_2) break;

    +351:                 eaname_len = ptr[0]

            __pyx_t_1 = __Pyx_PyInt_From_unsigned_char((__pyx_v_ptr[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_eaname_len, __pyx_t_1);
            __pyx_t_1 = 0;

    +352:                 eaname = (ptr+1)[:eaname_len]

            __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eaname_len); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L4_error)
            __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((const char*)(__pyx_v_ptr + 1)) + 0, __pyx_t_13 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_XDECREF_SET(__pyx_v_eaname, ((PyObject*)__pyx_t_1));
            __pyx_t_1 = 0;

    +353:                 retval.append(eaname)

            __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_retval, __pyx_v_eaname); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 353, __pyx_L4_error)

    +354:                 ptr += eaname_len + sizeof(unsigned char)

            __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(unsigned char))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_11 = PyNumber_Add(__pyx_v_eaname_len, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 354, __pyx_L4_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 354, __pyx_L4_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_v_ptr = (__pyx_v_ptr + __pyx_t_13);
          }

     355:

    +356:         return retval

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_retval);
        __pyx_r = __pyx_v_retval;
        goto __pyx_L3_return;
      }

     357:

     358:     finally:

    +359:         if data_buffer:

      /*finally:*/ {
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L4_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __pyx_t_2 = (__pyx_v_data_buffer != 0);
            if (__pyx_t_2) {
    /* … */
            }
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_16;
          goto __pyx_L1_error;
        }
        __pyx_L3_return: {
          __pyx_t_22 = __pyx_r;
          __pyx_r = 0;
          __pyx_t_2 = (__pyx_v_data_buffer != 0);
          if (__pyx_t_2) {
    /* … */
          }
          __pyx_r = __pyx_t_22;
          __pyx_t_22 = 0;
          goto __pyx_L0;
        }
      }

    +360:             free(data_buffer)

              free(__pyx_v_data_buffer);
    /* … */
            free(__pyx_v_data_buffer);

     361:

    +362: list = _list

      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_2, __pyx_t_1) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     363: