anchor.diff:  	false -> {error,badarg}
       end.
   	
  +
  +%% Passthrough all unknown - catch type errors later
  +filename2binary(List) when is_list(List) ->
  +    OutEncoding = file:native_name_encoding(),
  +    try unicode:characters_to_binary(List, unicode, OutEncoding) of
  +	Bin when is_binary(Bin) ->
  +	    Bin;
  +	_ ->
  +	    List
  +    catch
  +	error:badarg ->
  +	    List
  +    end;
  +filename2binary(Bin) ->
  +    Bin.
  +
  +binary2filename(Bin) ->
  +    InEncoding = file:native_name_encoding(),
  +    case unicode:characters_to_list(Bin, InEncoding) of
  +	Filename when is_list(Filename) ->
  +	    Filename;
  +	_ ->
  +	    %% For getopt/setopt of netns this should only happen if
  +	    %% a binary with wrong encoding was used when setting the
  +	    %% option, hence the user shall eat his/her own medicine.
  +	    %%
  +	    %% I.e passthrough here too for now.
  +	    %% Future usecases will most probably not want this,
  +	    %% rather Unicode error or warning
  +	    %% depending on emulator flag instead.
  +	    Bin
  +    end.
  +
   
   translate_ip(any,      inet) -> {0,0,0,0};
   translate_ip(loopback, inet) -> {127,0,0,1};
  
positive.code:       Options :: [socket_setopt()].
  
  setopts(Socket, Opts) -> 
      prim_inet:setopts(Socket, Opts).
  
  -spec getopts(Socket, Options) ->
  	{'ok', OptionValues} | {'error', posix()} when
  
negative.code: 	inet        -> udp_opt(Opts, R, As);
  	inet6       -> udp_opt(Opts, R, As);
  	{netns,NS} ->
  	    BinNS = filename2binary(NS),
  	    case prim_inet:is_sockopt_val(netns, BinNS) of
  		true ->
  		    list_opt(Opts, R#udp_opts { fd = [{netns,BinNS}] }, As);
  		false ->
  		    {error, badarg}
  	    end;
  