anchor.diff:      <<Op:32>> = list_to_binary(R).
   
   echo_to_busy(Config) when is_list(Config) ->
  -    ?line Dog = test_server:timetrap(test_server:seconds(10)),
  -    ?line load_control_drv(Config),
  -    ?line P = open_port({spawn, control_drv}, []),
  -    ?line erlang:port_control(P, $b, [1]),	% Set to busy.
  +    Dog = test_server:timetrap(test_server:seconds(10)),
  +    load_control_drv(Config),
  +    P = open_port({spawn, control_drv}, []),
  +    erlang:port_control(P, $b, [1]),	% Set to busy.
       Self = self(),
  -    ?line Echoer = spawn(fun() -> echoer(P, Self) end),
  -    ?line receive after 500 -> ok end,
  -    ?line erlang:port_control(P, $b, [0]),	% Set to not busy.
  -    ?line receive 
  -	      {Echoer, done} ->
  -		  ok;
  -	      {Echoer, Other} ->
  -		  test_server:fail(Other);
  -	      Other ->
  -		  test_server:fail({unexpected_message, Other})
  -	  end,
  -    ?line test_server:timetrap_cancel(Dog),
  +    Echoer = spawn(fun() -> echoer(P, Self) end),
  +    receive after 500 -> ok end,
  +    erlang:port_control(P, $b, [0]),	% Set to not busy.
  +    receive
  +        {Echoer, done} ->
  +            ok;
  +        {Echoer, Other} ->
  +            test_server:fail(Other);
  +        Other ->
  +            test_server:fail({unexpected_message, Other})
  +    end,
  +    test_server:timetrap_cancel(Dog),
       ok.
   
   echoer(P, ReplyTo) ->
  
positive.code: 
  %% Tests the port_connect/2 BIF.
  connect(Config) when is_list(Config) ->
      ?line load_control_drv(Config),
  
      ?line P = open_port({spawn, control_drv}, []),
      register(myport, P),
  
      ?line true = erlang:port_connect(myport, self()),
  
      %% Connect the port to another process.
  
      Data = "hello, world",
      Parent = self(),
      ?line Rec =
  	fun(Me) -> receive
  		       {P,{data,Data}} ->
  			   Parent ! connect_ok,
  			   Me(Me)
  		   end
  	end,
      ?line RecPid = spawn_link(fun() -> Rec(Rec) end),
      ?line true = erlang:port_connect(P, RecPid),
      ?line unlink(P),
  
      %% Send a command to the port and make sure that the
      %% other process receives the echo.
  
      ?line erlang:port_command(P, Data),
      ?line receive
  	      connect_ok -> ok
  	  end,
  
      %% Tests some errors.
  
      ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(self(), self())),
      ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(self(), P)),
      ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, P)),
      ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, xxxx)),
      ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, [])),
  
      ?line process_flag(trap_exit, true),
      ?line exit(P, you_should_die),
      ?line receive
  	      {'EXIT',RecPid,you_should_die} -> ok;
  	      Other -> ?line ?t:fail({bad_message,Other})
  	  end,
  
      %% Done.
      ok.
  
  %% Tests port_control/3
  control(Config) when is_list(Config) ->
      ?line load_control_drv(Config),
      ?line P = open_port({spawn, control_drv}, []),
  
      %% Test invalid (out-of-range) arguments.
  
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(self(), 1, [])),
  
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, -1, [])),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, -34887348739733833, [])),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 16#100000000, [])),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, a, [])),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 'e', dum)),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, dum)),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, fun(X) -> X end)),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e,
  							     [fun(X) -> X end])),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e,
  							     [1|fun(X) -> X end])),
  
      %% Test errors detected by the driver.
  
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 177, [])),
      ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 155,
  							     random_packet(1024))),
  
      %% Test big op codes.
  
      register(myport, P),
      ?line test_op(myport, 256),
      ?line test_op(P, 256),
      ?line test_op(P, 16#0033A837),
      ?line test_op(P, 16#0ab37938),
      ?line test_op(P, 16#eab37938),
      ?line test_op(P, 16#ffffFFFF),
  
      %% Test the echo function of the driver.
  
      ?line echo(P, 0),
      ?line echo(P, 1),
      ?line echo(P, 10),
      ?line echo(P, 13),
      ?line echo(P, 63),
      ?line echo(P, 64),
      ?line echo(P, 65),
      ?line echo(P, 127),
      ?line echo(P, 1023),
      ?line echo(P, 1024),
      ?line echo(P, 11243),
      ?line echo(P, 70000),
  
      %% Done.
  
      ?line true=erlang:port_close(myport),
      ok.
  
  test_op(P, Op) ->
  
negative.code:     end.
  
  do_port_info_os_pid() ->
      P = open_port({spawn, "echo $$"}, [eof]),
      A = erlang:port_info(P),
      {os_pid, InfoOSPid} = erlang:port_info(P, os_pid),
      EchoPidStr = receive
  	    {P, {data, EchoPidStr0}} -> EchoPidStr0
  	    after 10000 -> test_server:fail(timeout)
      end,
      {ok, [EchoPid], []} = io_lib:fread("~u\n", EchoPidStr),
      {value,{os_pid, InfoOSPid}}=lists:keysearch(os_pid, 1, A),
      EchoPid = InfoOSPid,
      true = erlang:port_close(P),
      ok.
  
  output_test(_, _, Input, Output) when Output > 16#1fffffff ->
  