# 1 "ufs_fsops.c"
 


















 

# 1 "ufs.h" 1
 


















 




# 1 "/usr1/gnu/DIST/include/mach.h" 1 3
 
























 



















 







# 1 "/usr1/gnu/DIST/include/mach/mach_types.h" 1 3
 
























 
































































































 











# 1 "/usr1/gnu/DIST/include/mach/host_info.h" 1 3
 
























 











































 








# 1 "/usr1/gnu/DIST/include/mach/machine.h" 1 3
 
























 





































































 













# 1 "/usr1/gnu/DIST/include/mach/machine/vm_types.h" 1 3
 
























 


























 












typedef	unsigned int	vm_offset_t;
typedef	unsigned int	vm_size_t;


# 110 "/usr1/gnu/DIST/include/mach/machine.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/boolean.h" 1 3
 
























 



























 









 




# 1 "/usr1/gnu/DIST/include/mach/machine/boolean.h" 1 3
 
























 






















 








typedef int		boolean_t;


# 69 "/usr1/gnu/DIST/include/mach/boolean.h" 2 3





 






# 91 "/usr1/gnu/DIST/include/mach/boolean.h" 3

# 111 "/usr1/gnu/DIST/include/mach/machine.h" 2 3


 








struct machine_info {
	int		major_version;	 
	int		minor_version;	 
	int		max_cpus;	 
	int		avail_cpus;	 
	vm_size_t	memory_size;	 
};

typedef struct machine_info	*machine_info_t;
typedef struct machine_info	machine_info_data_t;	 

typedef int	cpu_type_t;
typedef int	cpu_subtype_t;







struct machine_slot {
	boolean_t	is_cpu;		 
	cpu_type_t	cpu_type;	 
	cpu_subtype_t	cpu_subtype;	 
	boolean_t	running;	 
	long		cpu_ticks[	3 ];
	int		clock_freq;	 
};

typedef struct machine_slot	*machine_slot_t;
typedef struct machine_slot	machine_slot_data_t;	 






 



















 





 

















 







 










	 

	 

	 

 









 








 











 




	 

	 

	 

	 


 











 










 






 






 







# 79 "/usr1/gnu/DIST/include/mach/host_info.h" 2 3



 


typedef int	*host_info_t;		 


typedef int	host_info_data_t[(1024)		];


typedef char	kernel_version_t[(512) ];
 







struct host_basic_info {
	int		max_cpus;	 
	int		avail_cpus;	 
	vm_size_t	memory_size;	 
	cpu_type_t	cpu_type;	 
	cpu_subtype_t	cpu_subtype;	 
};

typedef	struct host_basic_info	host_basic_info_data_t;
typedef struct host_basic_info	*host_basic_info_t;



struct host_sched_info {
	int		min_timeout;	 
	int		min_quantum;	 
};

typedef	struct host_sched_info	host_sched_info_data_t;
typedef struct host_sched_info	*host_sched_info_t;



struct host_load_info {
	long		avenrun[3];	 
	long		mach_factor[3];	 
};

typedef struct host_load_info	host_load_info_data_t;
typedef struct host_load_info	*host_load_info_t;




# 135 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3



# 1 "/usr1/gnu/DIST/include/mach/memory_object.h" 1 3
 
























 



































 









 




# 1 "/usr1/gnu/DIST/include/mach/port.h" 1 3
 
























 







































 















# 1 "/usr1/gnu/DIST/include/mach/boolean.h" 1 3
 
























 



























 






# 72 "/usr1/gnu/DIST/include/mach/boolean.h" 3


 






# 91 "/usr1/gnu/DIST/include/mach/boolean.h" 3

# 82 "/usr1/gnu/DIST/include/mach/port.h" 2 3



typedef unsigned int mach_port_t;
typedef mach_port_t *mach_port_array_t;

 














 









typedef unsigned int mach_port_right_t;








typedef unsigned int mach_port_type_t;
typedef mach_port_type_t *mach_port_type_array_t;









 












 





 

typedef unsigned int mach_port_urefs_t;
typedef int mach_port_delta_t;			 

 

typedef unsigned int mach_port_seqno_t;		 
typedef unsigned int mach_port_mscount_t;	 
typedef unsigned int mach_port_msgcount_t;	 
typedef unsigned int mach_port_rights_t;	 

typedef struct mach_port_status {
	mach_port_t		mps_pset;	 
	mach_port_seqno_t	mps_seqno;	 
	mach_port_mscount_t	mps_mscount;	 
	mach_port_msgcount_t	mps_qlimit;	 
	mach_port_msgcount_t	mps_msgcount;	 
	mach_port_rights_t	mps_sorights;	 
	boolean_t		mps_srights;	 
	boolean_t		mps_pdrequest;	 
	boolean_t		mps_nsrequest;	 
} mach_port_status_t;




 




typedef struct old_mach_port_status {
	mach_port_t		mps_pset;	 
	mach_port_mscount_t	mps_mscount;	 
	mach_port_msgcount_t	mps_qlimit;	 
	mach_port_msgcount_t	mps_msgcount;	 
	mach_port_rights_t	mps_sorights;	 
	boolean_t		mps_srights;	 
	boolean_t		mps_pdrequest;	 
	boolean_t		mps_nsrequest;	 
} old_mach_port_status_t;


 



typedef int 		port_name_t;		 
typedef port_name_t	port_set_name_t;	 
typedef port_name_t	*port_name_array_t;

typedef int		port_type_t;		 
typedef port_type_t	*port_type_array_t;

	 









typedef	port_name_t	port_t;			 
typedef	port_t		port_rcv_t;		 
typedef	port_t		port_own_t;		 
typedef	port_t		port_all_t;		 
typedef	port_t		*port_array_t;






# 77 "/usr1/gnu/DIST/include/mach/memory_object.h" 2 3


typedef	mach_port_t	memory_object_t;
					 
					 
					 
					 

typedef	mach_port_t	memory_object_control_t;
					 
					 

typedef	mach_port_t	memory_object_name_t;
					 
					 

typedef	int		memory_object_copy_strategy_t;
					 

					 

					 

					 
					 

typedef	int		memory_object_return_t;
					 


					 

					 

					 




# 138 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3


# 1 "/usr1/gnu/DIST/include/mach/processor_info.h" 1 3
 
























 

































 












 


typedef int	*processor_info_t;	 


typedef int	processor_info_data_t[(1024)	];


typedef int	*processor_set_info_t;	 


typedef int	processor_set_info_data_t[(1024)	];

 




struct processor_basic_info {
	cpu_type_t	cpu_type;	 
	cpu_subtype_t	cpu_subtype;	 
	boolean_t	running;	 
	int		slot_num;	 
	boolean_t	is_master;	 
};

typedef	struct processor_basic_info	processor_basic_info_data_t;
typedef struct processor_basic_info	*processor_basic_info_t;






struct processor_set_basic_info {
	int		processor_count;	 
	int		task_count;		 
	int		thread_count;		 
	int		load_average;		 
	int		mach_factor;		 
};

 




typedef	struct processor_set_basic_info	processor_set_basic_info_data_t;
typedef struct processor_set_basic_info	*processor_set_basic_info_t;





struct processor_set_sched_info {
	int		policies;	 
	int		max_priority;	 
};

typedef	struct processor_set_sched_info	processor_set_sched_info_data_t;
typedef struct processor_set_sched_info	*processor_set_sched_info_t;




# 140 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/task_info.h" 1 3
 
























 























 












# 1 "/usr1/gnu/DIST/include/mach/time_value.h" 1 3
 
























 


































 



struct time_value {
	long	seconds;
	long	microseconds;
};
typedef	struct time_value	time_value_t;

 






















 








typedef struct mapped_time_value {
	long seconds;
	long microseconds;
	long check_seconds;
} mapped_time_value_t;


# 63 "/usr1/gnu/DIST/include/mach/task_info.h" 2 3


 


typedef	int	*task_info_t;		 


typedef	int	task_info_data_t[(1024)		];

 




struct task_basic_info {
	int		suspend_count;	 
	int		base_priority;	 
	vm_size_t	virtual_size;	 
	vm_size_t	resident_size;	 
	time_value_t	user_time;	 

	time_value_t	system_time;	 

};

typedef struct task_basic_info		task_basic_info_data_t;
typedef struct task_basic_info		*task_basic_info_t;






struct task_events_info {
	long		faults;		 
	long		zero_fills;	 
	long		reactivations;	 
	long		pageins;	 
	long		cow_faults;	 
	long		messages_sent;	 
	long		messages_received;  
};
typedef struct task_events_info		task_events_info_data_t;
typedef struct task_events_info		*task_events_info_t;






struct task_thread_times_info {
	time_value_t	user_time;	 

	time_value_t	system_time;	 

};

typedef struct task_thread_times_info	task_thread_times_info_data_t;
typedef struct task_thread_times_info	*task_thread_times_info_t;




# 141 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/task_special_ports.h" 1 3
 
























 























 





















 






















 















# 142 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/thread_info.h" 1 3
 
























 






























 













# 1 "/usr1/gnu/DIST/include/mach/boolean.h" 1 3
 
























 



























 






# 72 "/usr1/gnu/DIST/include/mach/boolean.h" 3


 






# 91 "/usr1/gnu/DIST/include/mach/boolean.h" 3

# 71 "/usr1/gnu/DIST/include/mach/thread_info.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/policy.h" 1 3
 
























 






























 





 









# 72 "/usr1/gnu/DIST/include/mach/thread_info.h" 2 3



 


typedef	int	*thread_info_t;		 


typedef	int	thread_info_data_t[	(1024)	];

 




struct thread_basic_info {
	time_value_t	user_time;	 
	time_value_t	system_time;	 
	int		cpu_usage;	 
	int		base_priority;	 
	int		cur_priority;	 
	int		run_state;	 
	int		flags;		 
	int		suspend_count;	 
	long		sleep_time;	 

};

typedef struct thread_basic_info	thread_basic_info_data_t;
typedef struct thread_basic_info	*thread_basic_info_t;



 





 











 







struct thread_sched_info {
	int		policy;		 
	int		data;		 
	int		base_priority;	 
	int		max_priority;    
	int		cur_priority;	 
	boolean_t	depressed;	 
	int		depress_priority;  
};

typedef struct thread_sched_info	thread_sched_info_data_t;
typedef struct thread_sched_info	*thread_sched_info_t;




# 143 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/thread_special_ports.h" 1 3
 
























 























 




















 
















 















# 144 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/thread_status.h" 1 3
 
























 




































 












 



# 1 "/usr1/gnu/DIST/include/mach/machine/thread_status.h" 1 3
 
























 








































 











# 1 "/usr1/gnu/DIST/include/mach/i386/fp_reg.h" 1 3
 
























 























 



struct i386_fp_save	{
	unsigned short	fp_control;	 
	unsigned short	fp_unused_1;
	unsigned short	fp_status;	 
	unsigned short	fp_unused_2;
	unsigned short	fp_tag;		 
	unsigned short	fp_unused_3;
	unsigned int	fp_eip;		 
	unsigned short	fp_cs;		 
	unsigned short	fp_opcode;	 
	unsigned int	fp_dp;		 
	unsigned short	fp_ds;		 
	unsigned short	fp_unused_4;
};

struct i386_fp_regs {
	unsigned short	fp_reg_word[5][8];
					 
};

 























 


















 








# 79 "/usr1/gnu/DIST/include/mach/machine/thread_status.h" 2 3

 




















 



struct i386_thread_state {
	unsigned int	gs;
	unsigned int	fs;
	unsigned int	es;
	unsigned int	ds;
	unsigned int	edi;
	unsigned int	esi;
	unsigned int	ebp;
	unsigned int	esp;
	unsigned int	ebx;
	unsigned int	edx;
	unsigned int	ecx;
	unsigned int	eax;
	unsigned int	eip;
	unsigned int	cs;
	unsigned int	efl;
	unsigned int	uesp;
	unsigned int	ss;
};


 



























struct i386_float_state {
	int		fpkind;			 
	int		initialized;
	unsigned char	hw_state[(sizeof (struct i386_fp_save) + sizeof (struct i386_fp_regs)) ];  
	int		exc_status;		 
};




struct i386_isa_port_map_state {
	unsigned char	pm[0x400 >>3];
};



 



struct i386_v86_assist_state {
	unsigned int	int_table;	 
	int		int_count;	 
};

struct v86_interrupt_table {
	unsigned int	count;	 
	unsigned short	mask;	 
	unsigned short	vec;	 
};





# 80 "/usr1/gnu/DIST/include/mach/thread_status.h" 2 3


 



typedef	int		*thread_state_t;	 


typedef	int	thread_state_data_t[(1024)		];




# 145 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3


# 1 "/usr1/gnu/DIST/include/mach/vm_attributes.h" 1 3
 
























 















 














 


typedef unsigned int	vm_machine_attribute_t;





 


typedef int		vm_machine_attribute_val_t;










# 147 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/vm_inherit.h" 1 3
 
























 



















 










 





typedef int		vm_inherit_t;	 

 











# 148 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/vm_prot.h" 1 3
 
























 


























 










 





typedef int		vm_prot_t;

 









 





 






# 149 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/vm_statistics.h" 1 3
 
























 




































 










struct vm_statistics {
	long	pagesize;		 
	long	free_count;		 
	long	active_count;		 
	long	inactive_count;		 
	long	wire_count;		 
	long	zero_fill_count;	 
	long	reactivations;		 
	long	pageins;		 
	long	pageouts;		 
	long	faults;			 
	long	cow_faults;		 
	long	lookups;		 
	long	hits;			 
};

typedef struct vm_statistics	*vm_statistics_t;
typedef struct vm_statistics	vm_statistics_data_t;





 






struct pmap_statistics {
	long		resident_count;	 
	long		wired_count;	 
};

typedef struct pmap_statistics	*pmap_statistics_t;

# 150 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3


# 160 "/usr1/gnu/DIST/include/mach/mach_types.h" 3

typedef	mach_port_t	task_t;
typedef task_t		*task_array_t;
typedef	task_t		vm_task_t;
typedef task_t		ipc_space_t;
typedef	mach_port_t	thread_t;
typedef	thread_t	*thread_array_t;
typedef mach_port_t	host_t;
typedef mach_port_t	host_priv_t;
typedef mach_port_t	processor_t;
typedef mach_port_t	*processor_array_t;
typedef mach_port_t	processor_set_t;
typedef mach_port_t	processor_set_name_t;
typedef mach_port_t	*processor_set_array_t;
typedef mach_port_t	*processor_set_name_array_t;
typedef vm_offset_t	*emulation_vector_t;


 



# 1 "/usr1/gnu/DIST/include/mach/std_types.h" 1 3
 
























 




























 









# 1 "/usr1/gnu/DIST/include/mach/boolean.h" 1 3
 
























 



























 






# 72 "/usr1/gnu/DIST/include/mach/boolean.h" 3


 

















# 65 "/usr1/gnu/DIST/include/mach/std_types.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/kern_return.h" 1 3
 
























 














































 











# 1 "/usr1/gnu/DIST/include/mach/machine/kern_return.h" 1 3
 
























 

























 











typedef	int		kern_return_t;


# 85 "/usr1/gnu/DIST/include/mach/kern_return.h" 2 3





		 



		 




		 





		 




		 



		 




		 




		 



		 





		 






 


		 



		 



		 




		 



		 



		 



		 



		 



		 



		 




		 



		 





# 66 "/usr1/gnu/DIST/include/mach/std_types.h" 2 3




typedef	vm_offset_t	pointer_t;






# 182 "/usr1/gnu/DIST/include/mach/mach_types.h" 2 3



typedef	vm_offset_t	vm_address_t;


# 54 "/usr1/gnu/DIST/include/mach.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/mach_interface.h" 1 3



 




# 1 "/usr1/gnu/DIST/include/mach/message.h" 1 3
 
























 


















































 
















 






typedef unsigned int mach_msg_timeout_t;

 






 















































 

























typedef unsigned int mach_msg_bits_t;
typedef	unsigned int mach_msg_size_t;
typedef unsigned int mach_msg_seqno_t;
typedef int mach_msg_id_t;

typedef	struct {
    mach_msg_bits_t	msgh_bits;
    mach_msg_size_t	msgh_size;
    mach_port_t		msgh_remote_port;
    mach_port_t		msgh_local_port;
    mach_port_seqno_t	msgh_seqno;
    mach_msg_id_t	msgh_id;
} mach_msg_header_t;

 





 












 
























typedef unsigned int mach_msg_type_name_t;
typedef unsigned int mach_msg_type_size_t;
typedef unsigned int mach_msg_type_number_t;

typedef struct  {
    unsigned int	msgt_name : 8,
			msgt_size : 8,
			msgt_number : 12,
			msgt_inline : 1,
			msgt_longform : 1,
			msgt_deallocate : 1,
			msgt_unused : 1;
} mach_msg_type_t;

typedef	struct	{
    mach_msg_type_t	msgtl_header;
    unsigned short	msgtl_name;
    unsigned short	msgtl_size;
    unsigned int	msgtl_number;
} mach_msg_type_long_t;


 



















 










 















 






 















typedef int mach_msg_option_t;


















 










typedef kern_return_t mach_msg_return_t;




		 

		 

		 

		 

		 


		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 


		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 

		 


extern mach_msg_return_t
mach_msg_trap

   (mach_msg_header_t *msg,
    mach_msg_option_t option,
    mach_msg_size_t send_size,
    mach_msg_size_t rcv_size,
    mach_port_t rcv_name,
    mach_msg_timeout_t timeout,
    mach_port_t notify);
# 462 "/usr1/gnu/DIST/include/mach/message.h" 3


extern mach_msg_return_t
mach_msg

   (mach_msg_header_t *msg,
    mach_msg_option_t option,
    mach_msg_size_t send_size,
    mach_msg_size_t rcv_size,
    mach_port_t rcv_name,
    mach_msg_timeout_t timeout,
    mach_port_t notify);
# 488 "/usr1/gnu/DIST/include/mach/message.h" 3



 



 







typedef	unsigned int	msg_size_t;

typedef	struct {
		unsigned int	msg_unused : 24,
				msg_simple : 8;
		msg_size_t	msg_size;
		int		msg_type;
		port_t		msg_local_port;
		port_t		msg_remote_port;
		int		msg_id;
} msg_header_t;



 











 

















typedef struct  {
	unsigned int	msg_type_name : 8,		 
			msg_type_size : 8,		 
			msg_type_number : 12,		 
			msg_type_inline : 1,		 
			msg_type_longform : 1,		 
			msg_type_deallocate : 1,	 
			msg_type_unused : 1;
} msg_type_t;

typedef	struct	{
	msg_type_t	msg_type_header;
	unsigned short	msg_type_long_name;
	unsigned short	msg_type_long_size;
	unsigned int	msg_type_long_number;
} msg_type_long_t;

 






















 








 






 



typedef	unsigned int	msg_timeout_t;

 






typedef	int		msg_option_t;












 







typedef	int		msg_return_t;













 





















 



msg_return_t	msg_send(

	msg_header_t	*header,
	msg_option_t	option,
	msg_timeout_t	timeout);
# 692 "/usr1/gnu/DIST/include/mach/message.h" 3


msg_return_t	msg_receive(

	msg_header_t	*header,
	msg_option_t	option,
	msg_timeout_t	timeout);
# 709 "/usr1/gnu/DIST/include/mach/message.h" 3


msg_return_t	msg_rpc(

	msg_header_t	*header,	 
	msg_option_t	option,
	msg_size_t	rcv_size,
	msg_timeout_t	send_timeout,
	msg_timeout_t	rcv_timeout);
# 731 "/usr1/gnu/DIST/include/mach/message.h" 3


msg_return_t	msg_send_trap(

	msg_header_t	*header,
	msg_option_t	option,
	msg_size_t	send_size,
	msg_timeout_t	timeout);
# 750 "/usr1/gnu/DIST/include/mach/message.h" 3


msg_return_t	msg_receive_trap(

	msg_header_t	*header,
	msg_option_t	option,
	msg_size_t	rcv_size,
	port_name_t	rcv_name,
	msg_timeout_t	timeout);
# 771 "/usr1/gnu/DIST/include/mach/message.h" 3


msg_return_t	msg_rpc_trap(

	msg_header_t	*header,	 
	msg_option_t	option,
	msg_size_t	send_size,
	msg_size_t	rcv_size,
	msg_timeout_t	send_timeout,
	msg_timeout_t	rcv_timeout);
# 795 "/usr1/gnu/DIST/include/mach/message.h" 3





# 9 "/usr1/gnu/DIST/include/mach/mach_interface.h" 2 3






 



extern

kern_return_t task_create








(
	mach_port_t target_task,
	boolean_t inherit_memory,
	mach_port_t *child_task
);





 



extern

kern_return_t task_terminate






(
	mach_port_t target_task
);





 



extern

kern_return_t task_get_emulation_vector









(
	mach_port_t task,
	int *vector_start,
	emulation_vector_t *emulation_vector,
	mach_msg_type_number_t *emulation_vectorCnt
);





 



extern

kern_return_t task_set_emulation_vector









(
	mach_port_t task,
	int vector_start,
	emulation_vector_t emulation_vector,
	mach_msg_type_number_t emulation_vectorCnt
);





 



extern

kern_return_t task_threads








(
	mach_port_t target_task,
	thread_array_t *thread_list,
	mach_msg_type_number_t *thread_listCnt
);





 



extern

kern_return_t task_info









(
	mach_port_t target_task,
	int flavor,
	task_info_t task_info_out,
	mach_msg_type_number_t *task_info_outCnt
);





 



extern

kern_return_t thread_terminate






(
	mach_port_t target_thread
);





 



extern

kern_return_t thread_get_state









(
	mach_port_t target_thread,
	int flavor,
	thread_state_t old_state,
	mach_msg_type_number_t *old_stateCnt
);





 



extern

kern_return_t thread_set_state









(
	mach_port_t target_thread,
	int flavor,
	thread_state_t new_state,
	mach_msg_type_number_t new_stateCnt
);





 



extern

kern_return_t thread_info









(
	mach_port_t target_thread,
	int flavor,
	thread_info_t thread_info_out,
	mach_msg_type_number_t *thread_info_outCnt
);





 



extern

kern_return_t vm_allocate









(
	mach_port_t target_task,
	vm_address_t *address,
	vm_size_t size,
	boolean_t anywhere
);





 



extern

kern_return_t vm_deallocate








(
	mach_port_t target_task,
	vm_address_t address,
	vm_size_t size
);





 



extern

kern_return_t vm_protect
# 336 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t target_task,
	vm_address_t address,
	vm_size_t size,
	boolean_t set_maximum,
	vm_prot_t new_protection
);





 



extern

kern_return_t vm_inherit









(
	mach_port_t target_task,
	vm_address_t address,
	vm_size_t size,
	vm_inherit_t new_inheritance
);





 



extern

kern_return_t vm_read
# 392 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t target_task,
	vm_address_t address,
	vm_size_t size,
	pointer_t *data,
	mach_msg_type_number_t *dataCnt
);





 



extern

kern_return_t vm_write









(
	mach_port_t target_task,
	vm_address_t address,
	pointer_t data,
	mach_msg_type_number_t dataCnt
);





 



extern

kern_return_t vm_copy









(
	mach_port_t target_task,
	vm_address_t source_address,
	vm_size_t size,
	vm_address_t dest_address
);





 



extern

kern_return_t vm_region
# 479 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t target_task,
	vm_address_t *address,
	vm_size_t *size,
	vm_prot_t *protection,
	vm_prot_t *max_protection,
	vm_inherit_t *inheritance,
	boolean_t *is_shared,
	mach_port_t *object_name,
	vm_offset_t *offset
);





 



extern

kern_return_t vm_statistics







(
	mach_port_t target_task,
	vm_statistics_data_t *vm_stats
);





 



extern

kern_return_t mach_ports_register








(
	mach_port_t target_task,
	mach_port_array_t init_port_set,
	mach_msg_type_number_t init_port_setCnt
);





 



extern

kern_return_t mach_ports_lookup








(
	mach_port_t target_task,
	mach_port_array_t *init_port_set,
	mach_msg_type_number_t *init_port_setCnt
);





 



extern

kern_return_t memory_object_data_provided
# 585 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t memory_control,
	vm_offset_t offset,
	pointer_t data,
	mach_msg_type_number_t dataCnt,
	vm_prot_t lock_value
);





 



extern

kern_return_t memory_object_data_unavailable








(
	mach_port_t memory_control,
	vm_offset_t offset,
	vm_size_t size
);





 



extern

kern_return_t memory_object_get_attributes









(
	mach_port_t memory_control,
	boolean_t *object_ready,
	boolean_t *may_cache,
	memory_object_copy_strategy_t *copy_strategy
);





 



extern

kern_return_t vm_set_default_memory_manager







(
	mach_port_t host_priv,
	mach_port_t *default_manager
);





 



extern

kern_return_t xxx_memory_object_lock_request
# 691 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t memory_control,
	vm_offset_t offset,
	vm_size_t size,
	boolean_t should_clean,
	boolean_t should_flush,
	vm_prot_t lock_value,
	mach_port_t reply_to
);





 



extern

kern_return_t memory_object_lock_request
# 724 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t memory_control,
	vm_offset_t offset,
	vm_size_t size,
	memory_object_return_t should_return,
	boolean_t should_flush,
	vm_prot_t lock_value,
	mach_port_t reply_to
);





 



extern

kern_return_t xxx_task_get_emulation_vector









(
	mach_port_t task,
	int *vector_start,
	emulation_vector_t emulation_vector,
	mach_msg_type_number_t *emulation_vectorCnt
);





 



extern

kern_return_t xxx_task_set_emulation_vector









(
	mach_port_t task,
	int vector_start,
	emulation_vector_t emulation_vector,
	mach_msg_type_number_t emulation_vectorCnt
);





 



extern

kern_return_t xxx_host_info







(
	mach_port_t target_task,
	machine_info_data_t *info
);





 



extern

kern_return_t xxx_slot_info








(
	mach_port_t target_task,
	int slot,
	machine_slot_data_t *info
);





 



extern

kern_return_t xxx_cpu_control








(
	mach_port_t target_task,
	int cpu,
	boolean_t running
);





 



extern

kern_return_t task_suspend






(
	mach_port_t target_task
);





 



extern

kern_return_t task_resume






(
	mach_port_t target_task
);





 



extern

kern_return_t task_get_special_port








(
	mach_port_t task,
	int which_port,
	mach_port_t *special_port
);





 



extern

kern_return_t task_set_special_port








(
	mach_port_t task,
	int which_port,
	mach_port_t special_port
);





 



extern

kern_return_t xxx_task_info









(
	mach_port_t target_task,
	int flavor,
	task_info_t task_info_out,
	mach_msg_type_number_t *task_info_outCnt
);





 



extern

kern_return_t thread_create







(
	mach_port_t parent_task,
	mach_port_t *child_thread
);





 



extern

kern_return_t thread_suspend






(
	mach_port_t target_thread
);





 



extern

kern_return_t thread_resume






(
	mach_port_t target_thread
);





 



extern

kern_return_t thread_abort






(
	mach_port_t target_thread
);





 



extern

kern_return_t xxx_thread_get_state









(
	mach_port_t target_thread,
	int flavor,
	thread_state_t old_state,
	mach_msg_type_number_t *old_stateCnt
);





 



extern

kern_return_t xxx_thread_set_state









(
	mach_port_t target_thread,
	int flavor,
	thread_state_t new_state,
	mach_msg_type_number_t new_stateCnt
);





 



extern

kern_return_t thread_get_special_port








(
	mach_port_t thread,
	int which_port,
	mach_port_t *special_port
);





 



extern

kern_return_t thread_set_special_port








(
	mach_port_t thread,
	int which_port,
	mach_port_t special_port
);





 



extern

kern_return_t xxx_thread_info









(
	mach_port_t target_thread,
	int flavor,
	thread_info_t thread_info_out,
	mach_msg_type_number_t *thread_info_outCnt
);





 



extern

kern_return_t task_set_emulation








(
	mach_port_t target_port,
	vm_address_t routine_entry_pt,
	int routine_number
);





 



extern

kern_return_t port_names
# 1243 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t task,
	mach_port_array_t *port_names_p,
	mach_msg_type_number_t *port_names_pCnt,
	mach_port_type_array_t *port_types,
	mach_msg_type_number_t *port_typesCnt
);





 



extern

kern_return_t port_type








(
	mach_port_t task,
	mach_port_t port_name,
	mach_port_type_t *port_type_p
);





 



extern

kern_return_t port_rename








(
	mach_port_t task,
	mach_port_t old_name,
	mach_port_t new_name
);





 



extern

kern_return_t port_allocate







(
	mach_port_t task,
	mach_port_t *port_name
);





 



extern

kern_return_t port_deallocate







(
	mach_port_t task,
	mach_port_t port_name
);





 



extern

kern_return_t port_set_backlog








(
	mach_port_t task,
	mach_port_t port_name,
	int backlog
);





 



extern

kern_return_t port_status
# 1395 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t task,
	mach_port_t port_name,
	mach_port_t *enabled,
	int *num_msgs,
	int *backlog,
	boolean_t *ownership,
	boolean_t *receive_rights
);





 



extern

kern_return_t port_set_allocate







(
	mach_port_t task,
	mach_port_t *set_name
);





 



extern

kern_return_t port_set_deallocate







(
	mach_port_t task,
	mach_port_t set_name
);





 



extern

kern_return_t port_set_add








(
	mach_port_t task,
	mach_port_t set_name,
	mach_port_t port_name
);





 



extern

kern_return_t port_set_remove







(
	mach_port_t task,
	mach_port_t port_name
);





 



extern

kern_return_t port_set_status









(
	mach_port_t task,
	mach_port_t set_name,
	mach_port_array_t *members,
	mach_msg_type_number_t *membersCnt
);





 



extern

kern_return_t port_insert_send








(
	mach_port_t task,
	mach_port_t my_port,
	mach_port_t his_name
);





 



extern

kern_return_t port_extract_send








(
	mach_port_t task,
	mach_port_t his_name,
	mach_port_t *his_port
);





 



extern

kern_return_t port_insert_receive








(
	mach_port_t task,
	mach_port_t my_port,
	mach_port_t his_name
);





 



extern

kern_return_t port_extract_receive








(
	mach_port_t task,
	mach_port_t his_name,
	mach_port_t *his_port
);





 



extern

kern_return_t vm_map
# 1653 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t target_task,
	vm_address_t *address,
	vm_size_t size,
	vm_address_t mask,
	boolean_t anywhere,
	mach_port_t memory_object,
	vm_offset_t offset,
	boolean_t copy,
	vm_prot_t cur_protection,
	vm_prot_t max_protection,
	vm_inherit_t inheritance
);





 



extern

kern_return_t memory_object_data_error









(
	mach_port_t memory_control,
	vm_offset_t offset,
	vm_size_t size,
	kern_return_t error_value
);





 



extern

kern_return_t memory_object_set_attributes









(
	mach_port_t memory_control,
	boolean_t object_ready,
	boolean_t may_cache,
	memory_object_copy_strategy_t copy_strategy
);





 



extern

kern_return_t memory_object_destroy







(
	mach_port_t memory_control,
	kern_return_t reason
);





 



extern

kern_return_t memory_object_data_supply
# 1768 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t memory_control,
	vm_offset_t offset,
	pointer_t data,
	mach_msg_type_number_t dataCnt,
	boolean_t dataDealloc,
	vm_prot_t lock_value,
	boolean_t precious,
	mach_port_t reply_to
);





 



extern

kern_return_t memory_object_ready








(
	mach_port_t memory_control,
	boolean_t may_cache,
	memory_object_copy_strategy_t copy_strategy
);





 



extern

kern_return_t memory_object_change_attributes









(
	mach_port_t memory_control,
	boolean_t may_cache,
	memory_object_copy_strategy_t copy_strategy,
	mach_port_t reply_to
);





 



extern

kern_return_t port_set_backup









(
	mach_port_t task,
	mach_port_t port_name,
	mach_port_t backup,
	mach_port_t *previous
);





 



extern

kern_return_t vm_machine_attribute
# 1879 "/usr1/gnu/DIST/include/mach/mach_interface.h" 3


(
	mach_port_t target_task,
	vm_address_t address,
	vm_size_t size,
	vm_machine_attribute_t attribute,
	vm_machine_attribute_val_t *value
);






# 55 "/usr1/gnu/DIST/include/mach.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/mach_port.h" 1 3



 










 



extern

kern_return_t mach_port_names
# 30 "/usr1/gnu/DIST/include/mach/mach_port.h" 3


(
	mach_port_t task,
	mach_port_array_t *names,
	mach_msg_type_number_t *namesCnt,
	mach_port_type_array_t *types,
	mach_msg_type_number_t *typesCnt
);





 



extern

kern_return_t mach_port_type








(
	mach_port_t task,
	mach_port_t name,
	mach_port_type_t *ptype
);





 



extern

kern_return_t mach_port_rename








(
	mach_port_t task,
	mach_port_t old_name,
	mach_port_t new_name
);





 



extern

kern_return_t mach_port_allocate_name








(
	mach_port_t task,
	mach_port_right_t right,
	mach_port_t name
);





 



extern

kern_return_t mach_port_allocate








(
	mach_port_t task,
	mach_port_right_t right,
	mach_port_t *name
);





 



extern

kern_return_t mach_port_destroy







(
	mach_port_t task,
	mach_port_t name
);





 



extern

kern_return_t mach_port_deallocate







(
	mach_port_t task,
	mach_port_t name
);





 



extern

kern_return_t mach_port_get_refs









(
	mach_port_t task,
	mach_port_t name,
	mach_port_right_t right,
	mach_port_urefs_t *refs
);





 



extern

kern_return_t mach_port_mod_refs









(
	mach_port_t task,
	mach_port_t name,
	mach_port_right_t right,
	mach_port_delta_t delta
);





 



extern

kern_return_t old_mach_port_get_receive_status








(
	mach_port_t task,
	mach_port_t name,
	old_mach_port_status_t *status
);





 



extern

kern_return_t mach_port_set_qlimit








(
	mach_port_t task,
	mach_port_t name,
	mach_port_msgcount_t qlimit
);





 



extern

kern_return_t mach_port_set_mscount








(
	mach_port_t task,
	mach_port_t name,
	mach_port_mscount_t mscount
);





 



extern

kern_return_t mach_port_get_set_status









(
	mach_port_t task,
	mach_port_t name,
	mach_port_array_t *members,
	mach_msg_type_number_t *membersCnt
);





 



extern

kern_return_t mach_port_move_member








(
	mach_port_t task,
	mach_port_t member,
	mach_port_t after
);





 



extern

kern_return_t mach_port_request_notification
# 388 "/usr1/gnu/DIST/include/mach/mach_port.h" 3


(
	mach_port_t task,
	mach_port_t name,
	mach_msg_id_t id,
	mach_port_mscount_t sync,
	mach_port_t notify,
	mach_msg_type_name_t notifyPoly,
	mach_port_t *previous
);





 



extern

kern_return_t mach_port_insert_right









(
	mach_port_t task,
	mach_port_t name,
	mach_port_t poly,
	mach_msg_type_name_t polyPoly
);





 



extern

kern_return_t mach_port_extract_right
# 446 "/usr1/gnu/DIST/include/mach/mach_port.h" 3


(
	mach_port_t task,
	mach_port_t name,
	mach_msg_type_name_t msgt_name,
	mach_port_t *poly,
	mach_msg_type_name_t *polyPoly
);





 



extern

kern_return_t mach_port_get_receive_status








(
	mach_port_t task,
	mach_port_t name,
	mach_port_status_t *status
);





 



extern

kern_return_t mach_port_set_seqno








(
	mach_port_t task,
	mach_port_t name,
	mach_port_seqno_t seqno
);






# 56 "/usr1/gnu/DIST/include/mach.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach_init.h" 1 3






 
extern mach_port_t __mach_task_self (void);

 
extern mach_port_t __mach_task_self_;


 
extern vm_size_t __vm_page_size;

 




 




# 57 "/usr1/gnu/DIST/include/mach.h" 2 3



# 25 "ufs.h" 2

# 1 "/usr1/gnu/DIST/hurd/include/sys/types.h" 1 3
 

















 






# 1 "/usr1/gnu/DIST/hurd/include/features.h" 1 3
 





















 




































 









 







 



 





 








 










































 
# 1 "/usr1/gnu/DIST/hurd/include/sys/cdefs.h" 1 3
 




















# 1 "/usr1/gnu/DIST/hurd/include/features.h" 1 3
 

















# 143 "/usr1/gnu/DIST/hurd/include/features.h" 3

# 22 "/usr1/gnu/DIST/hurd/include/sys/cdefs.h" 2 3







# 51 "/usr1/gnu/DIST/hurd/include/sys/cdefs.h" 3


 







 

typedef long double __long_double_t;

# 73 "/usr1/gnu/DIST/hurd/include/sys/cdefs.h" 3


 









 









# 141 "/usr1/gnu/DIST/hurd/include/features.h" 2 3



# 26 "/usr1/gnu/DIST/hurd/include/sys/types.h" 2 3


 

# 1 "/usr1/gnu/DIST/hurd/include/gnu/types.h" 1 3
 






















 
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
typedef struct
{
  long val[2];
} __quad;
typedef struct
{
  __u_long val[2];
} __u_quad;

typedef int __dev_t;		 
typedef unsigned int __uid_t;	 
typedef unsigned int __gid_t;	 
typedef unsigned long int __ino_t;	 
typedef unsigned int __mode_t;	 
typedef unsigned short int __nlink_t;	 
typedef long int __off_t;	 
typedef int __pid_t;		 
typedef int __ssize_t;		 
typedef __quad __fsid_t;	 

 
typedef long int __daddr_t;	 
typedef char *__caddr_t;
typedef long int __time_t;
typedef long int __swblk_t;	 



 

 


 




typedef struct
{
  unsigned long int __bits[(256  + ((sizeof(unsigned long int) * 8)  - 1)) / (sizeof(unsigned long int) * 8) ];
} __fd_set;

 








# 30 "/usr1/gnu/DIST/hurd/include/sys/types.h" 2 3






























# 1 "/usr1/gnu/DIST/hurd/include/time.h" 1 3
 

















 






















# 50 "/usr1/gnu/DIST/hurd/include/time.h" 3



















 
typedef __time_t time_t;





# 93 "/usr1/gnu/DIST/hurd/include/time.h" 3



# 191 "/usr1/gnu/DIST/hurd/include/time.h" 3



# 60 "/usr1/gnu/DIST/hurd/include/sys/types.h" 2 3



# 1 "/usr1/gnu/DIST/hurd/include/stddef.h" 1 3



 









 


 





 

 

# 57 "/usr1/gnu/DIST/hurd/include/stddef.h" 3


 

 





















typedef long unsigned int size_t;












 




 

# 137 "/usr1/gnu/DIST/hurd/include/stddef.h" 3




 
















# 63 "/usr1/gnu/DIST/hurd/include/sys/types.h" 2 3












# 1 "/usr1/gnu/DIST/hurd/include/gnu/time.h" 1 3
 






















 

struct __timeval
  {
    long int tv_sec;	 
    long int tv_usec;	 
  };

 
struct __timezone
  {
    int tz_minuteswest;	 
    int tz_dsttime;	 
  };


 
enum __itimer_which
  {
     
    ITIMER_REAL = 0,
     
    ITIMER_VIRTUAL = 1,
     

    ITIMER_PROF = 2,
  };

 

struct __itimerval
  {
     
    struct __timeval it_interval;
     
    struct __timeval it_value;
  };




# 75 "/usr1/gnu/DIST/hurd/include/sys/types.h" 2 3


 




extern int __select (int __nfds, __fd_set * __readfds,
			  __fd_set * __writefds, __fd_set * __exceptfds,
			  struct __timeval * __timeout)	;






 


# 26 "ufs.h" 2

# 1 "../hurd/hurd_types.h" 1 3
 





















typedef mach_port_t file_t;
typedef mach_port_t fsys_t;
typedef mach_port_t io_t;
typedef mach_port_t process_t;
typedef mach_port_t auth_t;
typedef mach_port_t socket_t;
typedef mach_port_t addr_port_t;
typedef mach_port_t startup_t;

typedef char *data_t;
typedef char string_t [1024];
typedef int *intarray_t;
typedef int *fd_mask_t;
typedef mach_port_t *portarray_t;
typedef __pid_t  *pidarray_t;
typedef __uid_t  *idarray_t;
typedef struct __rusage rusage_t;
typedef struct sockaddr *sockaddr_t;
typedef kern_return_t error_t;



typedef struct stat io_statbuf_t;

 






















 



 
enum
  {
    INIT_PORT_CWDIR,
    INIT_PORT_CRDIR,
    INIT_PORT_AUTH,
    INIT_PORT_PROC,
    INIT_PORT_LOGINCOLL,
     

    INIT_PORT_BOOTSTRAP,
    INIT_PORT_MAX
  };

 
enum
  {
    INIT_UMASK,
    INIT_CTTY_FSTYPE,
    INIT_CTTY_FSID1,
    INIT_CTTY_FSID2,
    INIT_CTTY_FILEID,
    INIT_SIGMASK,
    INIT_SIGIGN,
    INIT_INT_MAX,
  };

 










 



 


 
enum retry_type
{
  FS_RETRY_NONE,		 
  FS_RETRY_NORMAL,		 
  FS_RETRY_REAUTH,		 

   
  FS_RETRY_FD,			 
  FS_RETRY_TTY,			 
};
typedef enum retry_type retry_type;

 




 





 
struct fsys_statfsbuf
{
  long fsys_stb_type;
  long fsys_stb_bsize;
  long fsys_stb_fsize;
  long fsys_stb_blocks;
  long fsys_stb_bfree;
  long fsys_stb_bavail;
  long fsys_stb_files;
  long fsys_stb_ffree;
  long fsys_stb_fsid_1;
  long fsys_stb_fsid_2;
  long fsys_stb_spare[9];
};
typedef struct fsys_statfsbuf fsys_statfsbuf_t;

 
struct pathconf
{
  long link_max;
  long max_canon;
  long max_input;
  long name_max;
  long path_max;
  long pipe_buf;
  long _posix_chown_restricted;
  long _posix_no_trunc;
  long _posix_vdisable;
};
typedef struct pathconf pathconf_t;

 
enum verstype
{
  SYSNAME,
  RELEASE,
  VERSION,
  MACHINE,
};

struct procinfo
{
  int state;
  __uid_t  owner;
  __pid_t  ppid;
  __pid_t  pgrp;
  __pid_t  session;

  int nthreads;			 
  
  struct task_basic_info taskinfo;
  struct
    {
      struct thread_basic_info pis_bi;
      struct thread_sched_info pis_si;
    } threadinfos[0];
};
typedef int *procinfo_t;

 






 
enum termsig_stop_type
{
  WILLSTOP,			 
  IGNBLK,			 
  CATCH,			 
  ORPHANED,			 
  NOSIG,			 
};

 




 
struct idlist
{
  __uid_t  rid;
  __uid_t  svid;
  __uid_t  ids[0];
};



# 27 "ufs.h" 2

# 1 "/usr1/gnu/DIST/hurd/include/setjmp.h" 1 3
 

















 








 



 







 
# 1 "/usr1/gnu/DIST/hurd/include/jmp_buf.h" 1 3
 

typedef struct
  {
    long int __bx, __si, __di;
    void *  __bp;
    void *  __sp;
    void *  __pc;
  } __jmp_buf[1];
# 41 "/usr1/gnu/DIST/hurd/include/setjmp.h" 2 3





# 1 "/usr1/gnu/DIST/hurd/include/signal.h" 1 3
 

















 














# 1 "/usr1/gnu/DIST/hurd/include/gnu/signal.h" 1 3
 


















 


# 1 "/usr1/gnu/DIST/hurd/include/signum.h" 1 3
 

















# 65 "/usr1/gnu/DIST/hurd/include/signum.h" 3



# 23 "/usr1/gnu/DIST/hurd/include/gnu/signal.h" 2 3







typedef int __sig_atomic_t;

 


 
typedef unsigned long int __sigset_t;








 
typedef void (*__sighandler_t) (int)	;

 
struct __sigaction
{
   
  __sighandler_t sa_handler;

   
  __sigset_t sa_mask;

   
  int sa_flags;
};

 







# 34 "/usr1/gnu/DIST/hurd/include/signal.h" 2 3



# 1 "/usr1/gnu/DIST/hurd/include/stddef.h" 1 3



 









 


 





 

 

# 57 "/usr1/gnu/DIST/hurd/include/stddef.h" 3


 

 


# 91 "/usr1/gnu/DIST/hurd/include/stddef.h" 3





 




 

# 137 "/usr1/gnu/DIST/hurd/include/stddef.h" 3




 
















# 37 "/usr1/gnu/DIST/hurd/include/signal.h" 2 3










# 118 "/usr1/gnu/DIST/hurd/include/signal.h" 3












# 189 "/usr1/gnu/DIST/hurd/include/signal.h" 3




# 263 "/usr1/gnu/DIST/hurd/include/signal.h" 3



# 46 "/usr1/gnu/DIST/hurd/include/setjmp.h" 2 3


 
typedef struct
{
  __jmp_buf __jmpbuf;		 
  int __savemask;		 
  __sigset_t  __sigmask;		 
} sigjmp_buf[1];

 

extern void __sigjmp_save (sigjmp_buf __env, int __savemask)	;












 


extern __volatile  void siglongjmp (__const sigjmp_buf __env, int __val)	;












 
typedef __jmp_buf jmp_buf;




 

extern __volatile  void __longjmp (__const __jmp_buf __env, int __val)	;
extern __volatile  void longjmp (__const jmp_buf __env, int __val)	;





 
extern int __setjmp (__jmp_buf __env)	;
 




extern __volatile  void _longjmp (__const jmp_buf __env, int __val)	;


# 128 "/usr1/gnu/DIST/hurd/include/setjmp.h" 3


 





 


# 28 "ufs.h" 2

# 1 "../machine/ufs_machdep.h" 1 3
 


















 

# 1 "/usr1/gnu/DIST/include/cthreads.h" 1 3
 
























 









































































































 












# 1 "/usr1/gnu/DIST/include/machine/cthreads.h" 1 3
 
























 

































typedef __volatile  int spin_lock_t;





























# 145 "/usr1/gnu/DIST/include/cthreads.h" 2 3








typedef void *any_t;

# 163 "/usr1/gnu/DIST/include/cthreads.h" 3


# 1 "/usr1/gnu/DIST/include/mach/mach.h" 1 3
 
























 



















 




# 59 "/usr1/gnu/DIST/include/mach/mach.h" 3

# 165 "/usr1/gnu/DIST/include/cthreads.h" 2 3

# 1 "/usr1/gnu/DIST/include/mach/machine/vm_param.h" 1 3
 
























 







































 


















 







 

















						 

 







 






# 166 "/usr1/gnu/DIST/include/cthreads.h" 2 3







 



extern int cthread_init();
 

 


typedef struct cthread_queue {
	struct cthread_queue_item *head;
	struct cthread_queue_item *tail;
} *cthread_queue_t;

typedef struct cthread_queue_item {
	struct cthread_queue_item *next;
} *cthread_queue_item_t;










# 209 "/usr1/gnu/DIST/include/cthreads.h" 3




























 


extern void
spin_lock_solid (spin_lock_t *p) ;













 


typedef struct mutex {
	spin_lock_t lock;
	char *name;
	struct cthread_queue queue;
	spin_lock_t held;
} *mutex_t;










extern void
mutex_lock_solid (mutex_t m) ;		 

extern void
mutex_unlock_solid (mutex_t m) ;





 


typedef struct condition {
	spin_lock_t lock;
	struct cthread_queue queue;
	char *name;
} *condition_t;




















extern void
cond_signal (condition_t c) ;

extern void
cond_broadcast (condition_t c) ;

extern void
condition_wait (condition_t c, mutex_t m) ;

 



typedef any_t (*cthread_fn_t) (any_t arg) ;



typedef struct cthread {
	struct cthread *next;
	struct mutex lock;
	struct condition done;
	int state;
	jmp_buf catch;
	cthread_fn_t func;
	any_t arg;
	any_t result;
	char *name;
	any_t data;
	struct ur_cthread *ur;
} *cthread_t;



extern cthread_t
cthread_fork (cthread_fn_t func, any_t arg) ;

extern void
cthread_detach (cthread_t t) ;

extern any_t
cthread_join (cthread_t t) ;

extern void
cthread_yield();

extern void
cthread_exit (any_t result) ;

 


typedef struct ur_cthread {
	struct ur_cthread *next;
	cthread_t incarnation;
} *ur_cthread_t;






extern int cthread_stack_mask;
















extern void
cthread_set_name (cthread_t t, char *name) ;

extern char *
cthread_name (cthread_t t) ;

extern int
cthread_count();

extern void
cthread_set_limit (int n) ;

extern int
cthread_limit();




 


# 430 "/usr1/gnu/DIST/include/cthreads.h" 3









# 22 "../machine/ufs_machdep.h" 2 3


















# 29 "ufs.h" 2


 
 












 

 
typedef struct protid *protid_t;

 

 
mach_port_t ufs_control_port;	 
mach_port_t ufs_realnode;	 
file_t dotdot_file;		 

 
mach_port_t auth_server_port;

 
mach_port_t exec_server_port;

 
mach_port_t master_device_port;
mach_port_t ufs_device;		 

memory_object_t default_pager;	 

int readonly;			 

 
mach_port_t ufs_portset;	 

time_value_t *time;		 

struct fs *sblock;		 

int nextgennumber;		 

void *cgs;			 
void *dinodes;			 

int long_dir_consistency_checking;

struct mutex bootlock;
struct condition bootsync;


enum lookup_type
{
  LOOKUP,
  CREATE,
  REMOVE,
  RENAME,
};



enum slot_status
{
  LOOKING,
  TAKE,
  SHRINK,
  COMPRESS,
  EXTEND,
  HERE_TIS,
};

struct dirstat
{
  enum lookup_type type;
  enum slot_status stat;
  __off_t  blkoff;
  int prevoffinblk;
  int offinblk;
};

 
struct thread_stuff
{
  jmp_buf buf;
  struct thread_stuff *link;
};

 


 







 

struct protid
{
  int porttype;			 
  int refcnt;			 

  
  struct idlist *uids, *gids;
  int nuids, ngids;

  struct peropen *po;
  memory_object_t shared_object;
  struct shared_io *mapped;

  struct protid *nfree;
};

 
 
  
  
  
  
struct peropen
{
  int filepointer;
  int flock_status;		 
  int refcnt;
  int openstat;
  int state;
  struct inode *ip;

  struct peropen *nfree;
};

 





 
struct ioreq
{
  int porttype;			 
  int diskaddr;			 
  vm_address_t buffer;		 
  int amt;			 
  int error;			 
  void (*callback)();		 
};


 

 
error_t alloc (struct inode *, __daddr_t , __daddr_t , int, __daddr_t  *, 
	       struct protid *);
error_t realloccg (struct inode *, __daddr_t , __daddr_t , int, int, __daddr_t  *,
		   struct protid *);
error_t ialloc (__ino_t , __mode_t , struct inode **);
__ino_t  dirpref ();
__daddr_t  blkpref (struct inode *, __daddr_t , int, __daddr_t  *);
void blkfree (__daddr_t , int);
void ifree (__ino_t , __mode_t );

 
void dev_read (struct ioreq *);
void dev_write (struct ioreq *);
error_t dev_write_sync (__daddr_t , void *, long);
error_t dev_read_sync (__daddr_t , void **, long);
void devio_thread (void);

 
void register_memory_fault_area (void *, long);
void unregister_memory_fault_area (void *, long);
void init_exceptions ();

 
error_t do_stat (struct inode *, io_statbuf_t *);

 
fsys_t verify_fsys_port (fsys_t);

 
void inode_init (void);
error_t iget (__ino_t , struct inode **);
struct inode *ifind (__ino_t );
void iput (struct inode *);
void irele (struct inode *);
struct protid *convert_port_to_protid (mach_port_t);
mach_port_t convert_protid_to_port (struct protid *);
void release_protidport (struct protid *);
void release_peropen (struct peropen *);
void protid_nosenders (struct protid *);
struct protid *make_protid (struct inode *, int, struct protid *);

 
error_t fs_rdwr (struct inode *, char *, __off_t , int, int, struct protid *);
error_t file_extend (struct inode *, int, int, struct protid *);
__off_t  get_inode_vsize (struct inode *);
error_t fs_get_it (struct inode *);

 
error_t lookup (struct inode *, char *, enum lookup_type, 
		struct inode **, struct dirstat *, struct protid *);
error_t ufs_access (struct inode *, __mode_t , struct protid *);
int groupmember (__gid_t , struct protid *);
int isuid (__uid_t , struct protid *);
error_t isowner (struct inode *, struct protid *);
int dirempty (struct inode *, struct protid *);
error_t dirremove (struct inode *, struct dirstat *);
error_t direnter (struct inode *, char *, struct inode *,
		  struct dirstat *, struct protid *);
error_t dirrewrite (struct inode *, struct inode *, struct dirstat *);
error_t checkpath (struct inode *, struct inode *, struct protid *);
void dirbad (struct inode *, __off_t , char *);
error_t pathnamecheck (char *);
void dsrelease (struct dirstat *);
error_t ufs_checkdirmod (struct inode *, __mode_t ,
			 struct inode *, struct protid *);

 
void report_memory_fault (thread_t, int);
int thread_pc (thread_t);

 
__volatile  void panic (char *);
__volatile  void panic_with_error (char *, error_t);

 
void pager_init (void);
void pager_shutdown (void);
void inode_update (struct inode *, int);
void din_map (struct inode *);
void sin_map (struct inode *);
void sin_remap (struct inode *, int);
mach_port_t get_filemap (struct inode *);
void file_update (struct inode *, int);
void inode_truncate (struct inode *, __off_t );
void pager_nosenders (mach_port_t, int);
void sync_everything (int);

 
void fragacct (int, long *, int);
int isblock (__u_char  *, __daddr_t );
void setblock (__u_char  *, __daddr_t );
void clrblock (__u_char  *, __daddr_t );

 
void destroy_translator (struct inode *, int);


# 22 "ufs_fsops.c" 2

# 1 "fsdefs.h" 1



 









# 1 "/usr1/gnu/DIST/include/device/device_types.h" 1 3
 
























 



































 







 











 


typedef	mach_port_t	device_t;



 


typedef	char	dev_name_t[128];	 

 


typedef	int	dev_mode_t;





 


typedef char *	io_buf_ptr_t;

 



typedef char 	io_buf_ptr_inband_t[(128)		];

 


typedef	unsigned int	recnum_t;

 


typedef int		*dev_status_t;	 


typedef int		dev_status_data_t[(1024)		];

 


typedef	int		io_return_t;
















# 14 "fsdefs.h" 2

# 1 "/usr1/gnu/DIST/include/device/net_status.h" 1 3
 
























 
































 












 


struct net_status {
	int	min_packet_size;	 
	int	max_packet_size;	 
	int	header_format;		 
	int	header_size;		 
	int	address_size;		 
	int	flags;			 
	int	mapped_size;		 
};



 










 








 





 




















typedef	unsigned short	filter_t;
typedef filter_t	*filter_array_t;


 






 



















 









 



 













struct packet_header {
	unsigned short	length;
	unsigned short	type;	 
};

struct net_rcv_msg {
	mach_msg_header_t msg_hdr;
	mach_msg_type_t	header_type;
	char		header[64 ];
	mach_msg_type_t	packet_type;
	char		packet[4095 ];
};
typedef struct net_rcv_msg 	*net_rcv_msg_t;



# 15 "fsdefs.h" 2


# 1 "/usr1/gnu/DIST/hurd/include/sys/stat.h" 1 3
 

















 








 

# 1 "/usr1/gnu/DIST/hurd/include/statbuf.h" 1 3
 























struct stat
  {
    int st_fstype;		 
    __fsid_t st_fsid;		 
    __ino_t st_ino;		 
    unsigned int st_gen;	 
    __dev_t st_rdev;		 
    __mode_t st_mode;		 
    __nlink_t st_nlink;		 
    __uid_t st_uid;		 
    __gid_t st_gid;		 
    __off_t st_size;		 
    __time_t st_atime;		 
    unsigned long int st_atime_usec;  
    __time_t st_mtime;		 
    unsigned long int st_mtime_usec;  
    __time_t st_ctime;		 
    unsigned long int st_ctime_usec;  
    __uid_t st_author;		 
    __u_int  st_blksize;
    __u_int  st_blocks;
    int st_spare[8];		 
  };


# 30 "/usr1/gnu/DIST/hurd/include/sys/stat.h" 2 3













 















 











 











 





 



 
extern int __stat (__const char *__file, struct stat * __buf)	;
extern int stat (__const char *__file, struct stat * __buf)	;

 

extern int __fstat (int __fd, struct stat * __buf)	;
extern int fstat (int __fd, struct stat * __buf)	;

 

extern int __lstat (__const char *__file, struct stat * __buf)	;

extern int lstat (__const char *__file, struct stat * __buf)	;


 


extern int __chmod (__const char *__file, __mode_t __mode)	;
extern int chmod (__const char *__file, __mode_t __mode)	;

 
extern int __fchmod (int __fd, __mode_t __mode)	;

extern int fchmod (int __fd, __mode_t __mode)	;



 

extern __mode_t __umask (__mode_t __mask)	;
extern __mode_t umask (__mode_t __mask)	;


 

extern __mode_t getumask (void)	;


 
extern int __mkdir (__const char *__path, __mode_t __mode)	;
extern int mkdir (__const char *__path, __mode_t __mode)	;

 


extern int __mknod (__const char *__path,
			 __mode_t __mode, __dev_t __dev)	;

extern int mknod (__const char *__path,
		       __mode_t __mode, __dev_t __dev)	;



 
extern int mkfifo (__const char *__path, __mode_t __mode)	;

 


# 17 "fsdefs.h" 2




 



extern

kern_return_t file_exec
# 44 "fsdefs.h"


(
	protid_t exec_file,
	mach_port_t exec_task,
	int flags,
	data_t argv,
	mach_msg_type_number_t argvCnt,
	data_t envp,
	mach_msg_type_number_t envpCnt,
	portarray_t fdarray,
	mach_msg_type_number_t fdarrayCnt,
	portarray_t portarray,
	mach_msg_type_number_t portarrayCnt,
	intarray_t intarray,
	mach_msg_type_number_t intarrayCnt
);





 



extern

kern_return_t file_chown








(
	protid_t chown_file,
	__uid_t  new_owner,
	__gid_t  new_group
);





 



extern

kern_return_t file_chauthor







(
	protid_t chauth_file,
	__uid_t  new_author
);





 



extern

kern_return_t file_chmod







(
	protid_t chmod_file,
	__mode_t  new_mode
);





 



extern

kern_return_t file_chflags







(
	protid_t chflags_file,
	int new_flags
);





 



extern

kern_return_t file_utimes








(
	protid_t utimes_file,
	time_value_t new_atime,
	time_value_t new_mtime
);





 



extern

kern_return_t file_seek









(
	protid_t seek_file,
	int offset,
	int whence,
	int *newp
);





 



extern

kern_return_t file_truncate







(
	protid_t trunc_file,
	int new_size
);





 



extern

kern_return_t file_lock







(
	protid_t lock_file,
	int flags
);





 



extern

kern_return_t file_lock_stat








(
	protid_t lock_file,
	int *mystatus,
	int *otherstatus
);





 



extern

kern_return_t file_getcontrol







(
	protid_t file,
	mach_port_t *control
);





 



extern

kern_return_t file_statfs







(
	protid_t file,
	fsys_statfsbuf_t *info
);





 



extern

kern_return_t file_sync







(
	protid_t file,
	int wait
);





 



extern

kern_return_t file_syncfs








(
	protid_t file,
	int wait,
	int do_children
);





 



extern

kern_return_t file_pathconf







(
	protid_t file,
	pathconf_t *pathconf
);





 



extern

kern_return_t file_getlinknode







(
	protid_t file,
	protid_t *linknode
);





 



extern

kern_return_t file_getfh








(
	protid_t file,
	data_t *filehandle,
	mach_msg_type_number_t *filehandleCnt
);





 



extern

kern_return_t dir_pathtrans
# 465 "fsdefs.h"


(
	protid_t start_dir,
	string_t pathname,
	int flags,
	__mode_t  mode,
	retry_type *do_retry,
	string_t retry_name,
	protid_t *result
);





 



extern

kern_return_t dir_readdir
# 497 "fsdefs.h"


(
	protid_t dir,
	data_t *data,
	mach_msg_type_number_t *dataCnt,
	int offset,
	int *nextoffset,
	int amount
);





 



extern

kern_return_t dir_mkdir








(
	protid_t directory,
	string_t name,
	__mode_t  mode
);





 



extern

kern_return_t dir_rmdir







(
	protid_t directory,
	string_t name
);





 



extern

kern_return_t dir_unlink







(
	protid_t directory,
	string_t name
);





 



extern

kern_return_t dir_link








(
	protid_t oldfile,
	protid_t newdirectory,
	string_t newname
);





 



extern

kern_return_t dir_rename









(
	protid_t olddirectory,
	string_t oldname,
	protid_t newdirectory,
	string_t newname
);





 



extern

kern_return_t file_set_translator
# 651 "fsdefs.h"


(
	protid_t file,
	int flags,
	int oldtrans_flags,
	data_t translator,
	mach_msg_type_number_t translatorCnt,
	mach_port_t existing
);





 



extern

kern_return_t file_get_translator








(
	protid_t file,
	data_t *translator,
	mach_msg_type_number_t *translatorCnt
);





 



extern

kern_return_t file_get_translator_cntl







(
	protid_t file,
	fsys_t *translator_cntl
);






# 23 "ufs_fsops.c" 2

# 1 "ioudefs.h" 1



 
















 



extern

kern_return_t U_io_write
# 36 "ioudefs.h"


(
	io_t io_object,
	data_t data,
	mach_msg_type_number_t dataCnt,
	int offset,
	int *amount
);





 



extern

kern_return_t U_io_read
# 65 "ioudefs.h"


(
	io_t io_object,
	data_t *data,
	mach_msg_type_number_t *dataCnt,
	int offset,
	int amount
);





 



extern

kern_return_t U_io_readable







(
	io_t io_object,
	int *amount
);





 



extern

kern_return_t U_io_mod_nonblock







(
	io_t io_object,
	int on_or_off
);





 



extern

kern_return_t U_io_get_nonblock







(
	io_t io_object,
	int *on_or_off
);





 



extern

kern_return_t U_io_mod_append







(
	io_t io_object,
	int on_or_off
);





 



extern

kern_return_t U_io_get_append







(
	io_t io_object,
	int *on_or_off
);





 



extern

kern_return_t U_io_async








(
	io_t io_object,
	mach_port_t notify_port,
	mach_port_t *async_id_port
);





 



extern

kern_return_t U_io_mod_owner







(
	io_t io_object,
	__pid_t  owner
);





 



extern

kern_return_t U_io_get_owner







(
	io_t io_object,
	__pid_t  *owner
);





 



extern

kern_return_t U_io_mod_async_icky








(
	io_t io_object,
	int on_or_off,
	mach_port_t *icky_async_id_port
);





 



extern

kern_return_t U_io_get_icky_async_id







(
	io_t io_object,
	mach_port_t *icky_async_id_port
);





 



extern

kern_return_t U_io_get_async_icky







(
	io_t io_object,
	int *on_or_off
);





 



extern

kern_return_t U_io_get_openstat







(
	io_t io_object,
	int *open_stat
);





 



extern

kern_return_t U_io_select
# 374 "ioudefs.h"


(
	io_t io_object,
	int select_type,
	mach_port_t return_port,
	int id_tag,
	int *select_result
);





 



extern

kern_return_t U_io_stat







(
	io_t stat_object,
	io_statbuf_t *stat_info
);





 



extern

kern_return_t U_io_reauthenticate






(
	io_t auth_object
);





 



extern

kern_return_t U_io_server_version
# 447 "ioudefs.h"


(
	io_t vers_object,
	string_t server_name,
	int *server_major_version,
	int *server_minor_version,
	int *server_edit_level
);





 



extern

kern_return_t U_io_map









(
	io_t io_object,
	mach_port_t *memobjxx,
	mach_port_t *memobjrd,
	mach_port_t *memobjwt
);





 



extern

kern_return_t U_io_map_cntl







(
	io_t io_object,
	mach_port_t *memobj
);





 



extern

kern_return_t U_io_get_it







(
	io_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t U_io_release_it







(
	io_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t U_io_eofnotify







(
	io_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t U_io_prenotify









(
	io_t io_object,
	mach_port_t cntl,
	int write_start,
	int write_end
);





 



extern

kern_return_t U_io_postnotify









(
	io_t io_object,
	mach_port_t cntl,
	int write_start,
	int write_end
);





 



extern

kern_return_t U_io_readsleep







(
	io_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t U_io_sigio







(
	io_t io_object,
	mach_port_t cntl
);






# 24 "ufs_fsops.c" 2

# 1 "iodefs.h" 1



 
















 



extern

kern_return_t io_write
# 36 "iodefs.h"


(
	protid_t io_object,
	data_t data,
	mach_msg_type_number_t dataCnt,
	int offset,
	int *amount
);





 



extern

kern_return_t io_read
# 65 "iodefs.h"


(
	protid_t io_object,
	data_t *data,
	mach_msg_type_number_t *dataCnt,
	int offset,
	int amount
);





 



extern

kern_return_t io_readable







(
	protid_t io_object,
	int *amount
);





 



extern

kern_return_t io_mod_nonblock







(
	protid_t io_object,
	int on_or_off
);





 



extern

kern_return_t io_get_nonblock







(
	protid_t io_object,
	int *on_or_off
);





 



extern

kern_return_t io_mod_append







(
	protid_t io_object,
	int on_or_off
);





 



extern

kern_return_t io_get_append







(
	protid_t io_object,
	int *on_or_off
);





 



extern

kern_return_t io_async








(
	protid_t io_object,
	mach_port_t notify_port,
	mach_port_t *async_id_port
);





 



extern

kern_return_t io_mod_owner







(
	protid_t io_object,
	__pid_t  owner
);





 



extern

kern_return_t io_get_owner







(
	protid_t io_object,
	__pid_t  *owner
);





 



extern

kern_return_t io_mod_async_icky








(
	protid_t io_object,
	int on_or_off,
	mach_port_t *icky_async_id_port
);





 



extern

kern_return_t io_get_icky_async_id







(
	protid_t io_object,
	mach_port_t *icky_async_id_port
);





 



extern

kern_return_t io_get_async_icky







(
	protid_t io_object,
	int *on_or_off
);





 



extern

kern_return_t io_get_openstat







(
	protid_t io_object,
	int *open_stat
);





 



extern

kern_return_t io_select
# 374 "iodefs.h"


(
	protid_t io_object,
	int select_type,
	mach_port_t return_port,
	int id_tag,
	int *select_result
);





 



extern

kern_return_t io_stat







(
	protid_t stat_object,
	io_statbuf_t *stat_info
);





 



extern

kern_return_t io_reauthenticate






(
	protid_t auth_object
);





 



extern

kern_return_t io_server_version
# 447 "iodefs.h"


(
	protid_t vers_object,
	string_t server_name,
	int *server_major_version,
	int *server_minor_version,
	int *server_edit_level
);





 



extern

kern_return_t io_map









(
	protid_t io_object,
	mach_port_t *memobjxx,
	mach_port_t *memobjrd,
	mach_port_t *memobjwt
);





 



extern

kern_return_t io_map_cntl







(
	protid_t io_object,
	mach_port_t *memobj
);





 



extern

kern_return_t io_get_it







(
	protid_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t io_release_it







(
	protid_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t io_eofnotify







(
	protid_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t io_prenotify









(
	protid_t io_object,
	mach_port_t cntl,
	int write_start,
	int write_end
);





 



extern

kern_return_t io_postnotify









(
	protid_t io_object,
	mach_port_t cntl,
	int write_start,
	int write_end
);





 



extern

kern_return_t io_readsleep







(
	protid_t io_object,
	mach_port_t cntl
);





 



extern

kern_return_t io_sigio







(
	protid_t io_object,
	mach_port_t cntl
);






# 25 "ufs_fsops.c" 2

# 1 "fsysudefs.h" 1



 
















 



extern

kern_return_t U_fsys_startup









(
	mach_port_t bootstrap,
	fsys_t control_port,
	file_t *realnode,
	file_t *dotdot_node
);





 



extern

kern_return_t U_fsys_goaway







(
	fsys_t fsys,
	int flags
);





 



extern

kern_return_t U_fsys_getroot









(
	fsys_t fsys,
	int flags,
	mach_port_t auth_realnode,
	mach_port_t *file
);





 



extern

kern_return_t U_fsys_getfile
# 116 "fsysudefs.h"


(
	fsys_t fsys,
	idarray_t uids,
	mach_msg_type_number_t uidsCnt,
	idarray_t gids,
	mach_msg_type_number_t gidsCnt,
	data_t filehandle,
	mach_msg_type_number_t filehandleCnt,
	file_t *file
);






# 26 "ufs_fsops.c" 2

# 1 "inode.h" 1
 


















 

# 1 "/usr1/gnu/DIST/include/cthreads.h" 1 3
 
























 









































































































 









# 438 "/usr1/gnu/DIST/include/cthreads.h" 3

# 22 "inode.h" 2


 
struct inode
{
  struct inode *i_next;		 
  struct inode **i_prev;	 

  struct dinode *di;		 
  int i_number;			 
  short i_refcnt;		 
  struct inode *i_nfree;

  __pid_t  i_owner;

  fsys_t i_translator;		 

  int flock_type;		 
  struct condition i_flockwait;
  int needflock;
  int shlock_count;

   
  long i_diroff;		 
  __off_t  i_endoff;		 

  struct mutex i_shrinklock;	 
  int i_shrinkcount;
  struct condition i_shrinkwait;

  struct mutex i_dinlock;

   
  struct mutex i_sinlock;
  struct controlinfo *i_sininfo;  
  __daddr_t  *i_dinloc;		 

   
  struct mutex i_datalock;
  struct controlinfo *i_fileinfo;
  __daddr_t  *i_sinloc;		 

  struct mutex i_itlock;
  struct protid *i_it;		 

  struct mutex i_toplock;
  struct condition i_itwait;
  int i_allocsize;
};

 


















# 27 "ufs_fsops.c" 2

# 1 "dinode.h" 1
 


















 

 





















 






 




struct dinode {
	__u_short 	di_model;	 
	__nlink_t 	di_nlink;	 
	__u_short 	di_uidl;	 
	__u_short 	di_gidl;	 
	__u_quad 	di_qsize;	 
	time_t	di_atime;	 
	long	di_atusec;
	time_t	di_mtime;	 
	long	di_mtusec;
	time_t	di_ctime;	 
	long	di_ctusec;
	__daddr_t 	di_db[12		];	 
	__daddr_t 	di_ib[3		];	 
	long	di_flags;	 
	long	di_blocks;	 
	long	di_gen;		 
	long    di_trans;	 
	__uid_t    di_author;	 
	__u_short 	di_uidh;	 
	__u_short 	di_gidh;	 
	__u_short  di_modeh;	 
	short	di_spare;	 
};












 
















 











# 28 "ufs_fsops.c" 2

# 1 "fs.h" 1
 


















 

 





















 






























 


























 










 











 








struct csum {
	long	cs_ndir;	 
	long	cs_nbfree;	 
	long	cs_nifree;	 
	long	cs_nffree;	 
};

 




struct	fs
{
	struct	fs *fs_link;		 
	struct	fs *fs_rlink;		 
	__daddr_t 	fs_sblkno;		 
	__daddr_t 	fs_cblkno;		 
	__daddr_t 	fs_iblkno;		 
	__daddr_t 	fs_dblkno;		 
	long	fs_cgoffset;		 
	long	fs_cgmask;		 
	long 	fs_time;    		 
	long	fs_size;		 
	long	fs_dsize;		 
	long	fs_ncg;			 
	long	fs_bsize;		 
	long	fs_fsize;		 
	long	fs_frag;		 
 
	long	fs_minfree;		 
	long	fs_rotdelay;		 
	long	fs_rps;			 
 
	long	fs_bmask;		 
	long	fs_fmask;		 
	long	fs_bshift;		 
	long	fs_fshift;		 
 
	long	fs_maxcontig;		 
	long	fs_maxbpg;		 
 
	long	fs_fragshift;		 
	long	fs_fsbtodb;		 
	long	fs_sbsize;		 
	long	fs_csmask;		 
	long	fs_csshift;		 
	long	fs_nindir;		 
	long	fs_inopb;		 
	long	fs_nspf;		 
 
	long	fs_optim;		 
 
	long	fs_npsect;		 
	long	fs_interleave;		 
	long	fs_trackskew;		 
	long	fs_headswitch;		 
	long	fs_trkseek;		 
 
	__daddr_t  fs_csaddr;		 
	long	fs_cssize;		 
	long	fs_cgsize;		 
 
	long	fs_ntrak;		 
	long	fs_nsect;		 
	long  	fs_spc;   		 
 
	long	fs_ncyl;   		 
 
	long	fs_cpg;			 
	long	fs_ipg;			 
	long	fs_fpg;			 
 
	struct	csum fs_cstotal;	 
 
	char   	fs_fmod;    		 
	char   	fs_clean;    		 
	char   	fs_ronly;   		 
	char   	fs_flags;   		 
	char	fs_fsmnt[512 ];	 
 
	long	fs_cgrotor;		 
	struct	csum *fs_csp[32 ]; 
	long	fs_cpc;			 
	short	fs_opostbl[16][8];	 
	long	fs_sparecon[55];	 
	long	fs_state;		 
	__quad 	fs_qbmask;		 
	__quad 	fs_qfmask;		 
	long	fs_postblformat;	 
	long	fs_nrpos;		 
	long	fs_postbloff;		 
	long	fs_rotbloff;		 
	long	fs_magic;		 
	unsigned char	fs_space[1];     
 
};
 





 




 












 







 



struct	cg {
	struct	cg *cg_link;		 
	long	cg_magic;		 
	long	cg_time;		 
	long	cg_cgx;			 
	short	cg_ncyl;		 
	short	cg_niblk;		 
	long	cg_ndblk;		 
	struct	csum cg_cs;		 
	long	cg_rotor;		 
	long	cg_frotor;		 
	long	cg_irotor;		 
	long	cg_frsum[8 ];	 
	long	cg_btotoff;		 
	long	cg_boff;		 
	long	cg_iusedoff;		 
	long	cg_freeoff;		 
	long	cg_nextfreeoff;		 
	long	cg_sparecon[16];	 
	unsigned char	cg_space[1];     
 
};
 





















 



struct	ocg {
	struct	ocg *cg_link;		 
	struct	ocg *cg_rlink;		 
	long	cg_time;		 
	long	cg_cgx;			 
	short	cg_ncyl;		 
	short	cg_niblk;		 
	long	cg_ndblk;		 
	struct	csum cg_cs;		 
	long	cg_rotor;		 
	long	cg_frotor;		 
	long	cg_irotor;		 
	long	cg_frsum[8];		 
	long	cg_btot[32];		 
	short	cg_b[32][8];		 
	char	cg_iused[256];		 
	long	cg_magic;		 
	unsigned char cg_free[1];        
 
};

 






 











 











 






 












 



























 







 











 





 





 







# 29 "ufs_fsops.c" 2

# 1 "dir.h" 1
 
























 



























struct	direct {
	__u_long 	d_ino;			 
	__u_short 	d_reclen;		 
	__u_short 	d_namlen;		 
	char	d_name[255  + 1];	 
};

 





 




 




struct dirtemplate {
	__u_long 	dot_ino;
	short	dot_reclen;
	short	dot_namlen;
	char	dot_name[4];		 
	__u_long 	dotdot_ino;
	short	dotdot_reclen;
	short	dotdot_namlen;
	char	dotdot_name[4];		 
};

# 30 "ufs_fsops.c" 2

# 1 "/usr1/gnu/DIST/hurd/include/limits.h" 1 3
 

















 








 
# 1 "/usr1/gnu/DIST/hurd/include/posix1_lim.h" 1 3
 

















 








 

 


 


 


 


 



 


 


 


 


 


 


 


 



 
# 1 "/usr1/gnu/DIST/hurd/include/local_lim.h" 1 3
 











# 72 "/usr1/gnu/DIST/hurd/include/posix1_lim.h" 2 3








 







# 29 "/usr1/gnu/DIST/hurd/include/limits.h" 2 3




# 1 "/usr1/gnu/DIST/hurd/include/posix2_lim.h" 1 3
 






















 


 


 


 


 



 



 


 




 






























# 33 "/usr1/gnu/DIST/hurd/include/limits.h" 2 3






 
 
# 1 "/usr1/gnu/DIST/lib/gcc-lib/i386-compaq-bsd4.3/2.2.2/include/limits.h" 1 3



 



 



 



 





 



 












 





 



 





 



 






 




 





 






# 40 "/usr1/gnu/DIST/hurd/include/limits.h" 2 3


# 104 "/usr1/gnu/DIST/hurd/include/limits.h" 3




# 31 "ufs_fsops.c" 2

# 1 "/usr1/gnu/DIST/hurd/include/unistd.h" 1 3
 

















 








 

 


 


 




 



 



 




 


























# 1 "/usr1/gnu/DIST/hurd/include/posix_opt.h" 1 3





# 81 "/usr1/gnu/DIST/hurd/include/unistd.h" 2 3



 





 








# 1 "/usr1/gnu/DIST/hurd/include/stddef.h" 1 3



 









 


 





 

 

# 57 "/usr1/gnu/DIST/hurd/include/stddef.h" 3


 

 


# 91 "/usr1/gnu/DIST/hurd/include/stddef.h" 3





 




 

# 137 "/usr1/gnu/DIST/hurd/include/stddef.h" 3




 
















# 99 "/usr1/gnu/DIST/hurd/include/unistd.h" 2 3



 






 
extern int __access (__const char *__name, int __type)	;
extern int access (__const char *__name, int __type)	;






 






 




extern __off_t __lseek (int __fd, __off_t __offset, int __whence)	;
extern __off_t lseek (int __fd, __off_t __offset, int __whence)	;

 
extern int __close (int __fd)	;
extern int close (int __fd)	;

 

extern __ssize_t  __read (int __fd, void *  __buf, size_t __nbytes)	;
extern __ssize_t  read (int __fd, void *  __buf, size_t __nbytes)	;

 
extern __ssize_t  __write (int __fd, __const void *  __buf, size_t __n)	;
extern __ssize_t  write (int __fd, __const void *  __buf, size_t __n)	;









 



extern int __pipe (int __pipedes[2])	;
extern int pipe (int __pipedes[2])	;





 






extern unsigned int alarm (unsigned int __seconds)	;

 






extern unsigned int sleep (unsigned int __seconds)	;


 

extern int pause (void)	;


 
extern int __chown (__const char *__file,
			 __uid_t __owner, __gid_t __group)	;
extern int chown (__const char *__file,
		       __uid_t __owner, __gid_t __group)	;






 
extern int __fchown (int __fd,
			  __uid_t __owner, __gid_t __group)	;
extern int fchown (int __fd,
			__uid_t __owner, __gid_t __group)	;





 
extern int __chdir (__const char *__path)	;
extern int chdir (__const char *__path)	;





 






extern char *getcwd (char *__buf, size_t __size)	;


 


extern char *get_current_dir_name (void)	;



 


extern char *getwd (char *__buf)	;



 
extern int __dup (int __fd)	;
extern int dup (int __fd)	;





 
extern int __dup2 (int __fd, int __fd2)	;
extern int dup2 (int __fd, int __fd2)	;





 
extern char **__environ;
extern char **environ;


 

extern int __execve (__const char *__path, char *__const __argv[],
			  char *__const __envp[])	;
extern int execve (__const char *__path, char *__const __argv[],
			char *__const __envp[])	;



 
extern int execv (__const char *__path, char *__const __argv[])	;

 

extern int execle (__const char *__path, __const char *__arg,...)	;

 

extern int execl (__const char *__path, __const char *__arg,...)	;

 

extern int execvp (__const char *__file, char *__const __argv[])	;

 


extern int execlp (__const char *__file, __const char *arg,...)	;











 
extern __volatile  void _exit (int __status)	;


 












 
extern long int __pathconf (__const char *__path, int __name)	;
extern long int pathconf (__const char *__path, int __name)	;

 
extern long int __fpathconf (int __fd, int __name)	;
extern long int fpathconf (int __fd, int __name)	;

 



 


enum
{
  _SC_ARG_MAX,
  _SC_CHILD_MAX,
  _SC_CLK_TCK,
  _SC_NGROUPS_MAX,
  _SC_OPEN_MAX,
  _SC_STREAM_MAX,
  _SC_TZNAME_MAX,
  _SC_JOB_CONTROL,
  _SC_SAVED_IDS,
  _SC_VERSION,

   

  _SC_BC_BASE_MAX,
  _SC_BC_DIM_MAX,
  _SC_BC_SCALE_MAX,
  _SC_BC_STRING_MAX,
  _SC_COLL_WEIGHTS_MAX,
  _SC_EQUIV_CLASS_MAX,
  _SC_EXPR_NEST_MAX,
  _SC_LINE_MAX,
  _SC_RE_DUP_MAX,

  _SC_2_VERSION,
  _SC_2_C_BIND,
  _SC_2_C_DEV,
  _SC_2_FORT_DEV,
  _SC_2_FORT_RUN,
  _SC_2_SW_DEV,
  _SC_2_LOCALEDEF
};


 
extern long int __sysconf (int __name)	;
extern long int sysconf (int __name)	;







 


 
extern size_t confstr (int __name, char *__buf, size_t __len)	;



 
extern __pid_t __getpid (void)	;
extern __pid_t getpid (void)	;

 
extern __pid_t __getppid (void)	;
extern __pid_t getppid (void)	;






 
extern __pid_t __getpgrp (__pid_t __pid)	;


 
extern __pid_t getpgrp (void)	;




 


extern int __setpgrp (__pid_t __pid, __pid_t __pgid)	;
extern int setpgid (__pid_t __pid, __pid_t __pgid)	;






 
extern int setpgrp (__pid_t __pid, __pid_t __pgrp)	;






 


extern __pid_t __setsid (void)	;
extern __pid_t setsid (void)	;





 
extern __uid_t __getuid (void)	;
extern __uid_t getuid (void)	;





 
extern __uid_t __geteuid (void)	;
extern __uid_t geteuid (void)	;





 
extern __gid_t __getgid (void)	;
extern __gid_t getgid (void)	;





 
extern __gid_t __getegid (void)	;
extern __gid_t getegid (void)	;





 


extern int __getgroups (int __size, __gid_t __list[])	;
extern int getgroups (int __size, __gid_t __list[])	;

 



extern int __setuid (__uid_t __uid)	;
extern int setuid (__uid_t __uid)	;






 

extern int __setreuid (__uid_t __ruid, __uid_t __euid)	;
extern int setreuid (__uid_t __ruid, __uid_t __euid)	;





 
extern int seteuid (__uid_t __uid)	;


 



extern int __setgid (__gid_t __gid)	;
extern int setgid (__gid_t __gid)	;






 

extern int __setregid (__gid_t __rgid, __gid_t __egid)	;
extern int setregid (__gid_t __rgid, __gid_t __egid)	;





 
extern int seteuid (__uid_t __uid)	;



 


extern __pid_t __fork (void)	;
extern __pid_t fork (void)	;




 



extern __pid_t __vfork (void)	;
extern __pid_t vfork (void)	;





 

extern char *ttyname (int __fd)	;

 

extern int __isatty (int __fd)	;
extern int isatty (int __fd)	;






 
extern int __link (__const char *__from, __const char *__to)	;
extern int link (__const char *__from, __const char *__to)	;
 


 
extern int __symlink (__const char *__from, __const char *__to)	;
extern int symlink (__const char *__from, __const char *__to)	;





 


extern int __readlink (__const char *__path, char *__buf, size_t __len)	;
extern int readlink (__const char *__path, char *__buf, size_t __len)	;






 
extern int __unlink (__const char *__name)	;
extern int unlink (__const char *__name)	;





 
extern int __rmdir (__const char *__path)	;
extern int rmdir (__const char *__path)	;






 
extern __pid_t tcgetpgrp (int __fd)	;

 
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id)	;


 
extern char *getlogin (void)	;


 
extern int setlogin (__const char *__name)	;




 
























extern int getopt (int __argc, char *__const * __argv,
			__const char *__opts)	;
extern int opterr;
extern int optind;
extern int optopt;
extern char *optarg;





 


extern int __gethostname (char *__name, size_t __len)	;
extern int gethostname (char *__name, size_t __len)	;





 

extern int sethostname (__const char *__name, size_t __len)	;

 
extern long int gethostid (void)	;

 

extern int sethostid (long int __id)	;


 

extern size_t __getpagesize (void)	;
extern size_t getpagesize (void)	;






 

extern int __getdtablesize (void)	;
extern int getdtablesize (void)	;






 
extern int fsync (int __fd)	;

 
extern int sync (void)	;


 


extern int vhangup (void)	;


 


extern int acct (__const char *__name)	;

 

extern int chroot (__const char *__path)	;

 

extern int swapon (__const char *__path)	;

 
extern int reboot (int __howto)	;


 
extern char *getusershell (void)	;
extern void endusershell (void)	;  
extern void setusershell (void)	;  

 

extern char *getpass (	__const  char *__prompt)	;




 


# 32 "ufs_fsops.c" 2

# 1 "/usr1/gnu/DIST/hurd/include/stdlib.h" 1 3
 

















 








 

 



# 1 "/usr1/gnu/DIST/hurd/include/stddef.h" 1 3



 









 


 





 

 

# 57 "/usr1/gnu/DIST/hurd/include/stddef.h" 3


 

 


# 91 "/usr1/gnu/DIST/hurd/include/stddef.h" 3





 




 
























 
typedef int wchar_t;













 
















# 34 "/usr1/gnu/DIST/hurd/include/stdlib.h" 2 3



# 1 "/usr1/gnu/DIST/hurd/include/errno.h" 1 3
 

















 








 

 
# 1 "/usr1/gnu/DIST/hurd/include/errnos.h" 1 3









































































































































































# 31 "/usr1/gnu/DIST/hurd/include/errno.h" 2 3


 
extern __volatile int errno;

 


# 37 "/usr1/gnu/DIST/hurd/include/stdlib.h" 2 3


 
# 1 "/usr1/gnu/DIST/hurd/include/huge_val.h" 1 3
 























# 1 "/usr1/gnu/DIST/hurd/include/endian.h" 1 3







# 25 "/usr1/gnu/DIST/hurd/include/huge_val.h" 2 3


 


















# 40 "/usr1/gnu/DIST/hurd/include/stdlib.h" 2 3



 
typedef struct
{
  int quot;			 
  int rem;			 
} div_t;

 
typedef struct
{
  long int quot;		 
  long int rem;			 
} ldiv_t;


 



 





 




 
extern double atof (__const char *__nptr)	;
 
extern int atoi (__const char *__nptr)	;
 
extern long int atol (__const char *__nptr)	;

 
extern double strtod (__const char *__nptr, char **__endptr)	;
 
extern long int strtol (__const char *__nptr, char **__endptr,
			     int __base)	;
 
extern unsigned long int strtoul (__const char *__nptr,
				       char **__endptr, int __base)	;








 
extern int rand (void)	;
 
extern void srand (unsigned int __seed)	;

 



 
extern long int __random (void)	;
 
extern void __srandom (unsigned int __seed)	;

 



extern void *  __initstate (unsigned int __seed, void *  __statebuf,
				 size_t __statelen)	;
 

extern void *  __setstate (void *  __statebuf)	;


extern long int random (void)	;
extern void srandom (unsigned int __seed)	;
extern void *  initstate (unsigned int __seed, void *  __statebuf,
			       size_t __statelen)	;
extern void *  setstate (void *  __statebuf)	;















 
extern void *  malloc (size_t __size)	;
 

extern void *  realloc (void *  __ptr, size_t __size)	;
 
extern void *  calloc (size_t __nmemb, size_t __size)	;
 
extern void free (void *  __ptr)	;


 
extern void cfree (void *  __ptr)	;







# 1 "/usr1/gnu/DIST/hurd/include/alloca.h" 1 3
 






















# 1 "/usr1/gnu/DIST/hurd/include/stddef.h" 1 3



 









 


 





 

 

# 57 "/usr1/gnu/DIST/hurd/include/stddef.h" 3


 

 


# 91 "/usr1/gnu/DIST/hurd/include/stddef.h" 3





 




 

# 137 "/usr1/gnu/DIST/hurd/include/stddef.h" 3




 
















# 24 "/usr1/gnu/DIST/hurd/include/alloca.h" 2 3


 

 



 
extern void *  __alloca (size_t __size)	;
extern void *  alloca (size_t __size)	;







 


# 161 "/usr1/gnu/DIST/hurd/include/stdlib.h" 2 3




 
extern void *  valloc (size_t __size)	;












 
extern __volatile  void abort (void)	;


 
extern int atexit (void (*__func) (void))	;


 

extern int on_exit (void (*__func) (int __status, void *  __arg),
			 void *  __arg)	;


 


extern __volatile  void exit (int __status)	;


 
extern char *getenv (__const char *__name)	;


 
 

extern int putenv (__const char *__string)	;



 

extern int setenv (__const char *__name, __const char *__value,
			int __replace)	;


 
extern int system (__const char *__command)	;


 
typedef int (*__compar_fn_t) (__const void * , __const void * );





 

extern void *  bsearch (__const void *  __key, __const void *  __base,
			     size_t __nmemb, size_t __size,
			     __compar_fn_t __compar)	;

 

extern void qsort (void *  __base, size_t __nmemb, size_t __size,
			__compar_fn_t __compar)	;




 







 
extern __const  int abs (int __x)	;
extern __const  long int labs (long int __x)	;







 

 
extern __const  div_t div (int __numer, int __denom)	;
extern __const  ldiv_t ldiv (long int __numer, long int __denom)	;


 

extern int mblen (__const char *__s, size_t __n)	;
 

extern int mbtowc (wchar_t * __pwc, __const char *__s, size_t __n)	;
 

extern int wctomb (char *__s, wchar_t __wchar)	;






 
extern size_t mbstowcs (wchar_t * __pwcs, __const char *__s, size_t __n)	;
 
extern size_t wcstombs (char *__s, __const wchar_t * __pwcs, size_t __n)	;


 


# 33 "ufs_fsops.c" 2

# 1 "/usr1/gnu/DIST/hurd/include/sys/file.h" 1 3
 






















 

# 1 "/usr1/gnu/DIST/hurd/include/fcntl.h" 1 3
 

















 








 

# 1 "/usr1/gnu/DIST/hurd/include/fcntlbits.h" 1 3
 

























 











 



 

struct __flock
  {
    short int l_type;	 
    short int l_whence;	 
    __off_t l_start;	 
    __off_t l_len;	 
    __pid_t l_pid;	 
  };







# 30 "/usr1/gnu/DIST/hurd/include/fcntl.h" 2 3

# 1 "/usr1/gnu/DIST/hurd/include/filebits.h" 1 3
 






















 





 





 



 



 


 




 




 



# 31 "/usr1/gnu/DIST/hurd/include/fcntl.h" 2 3



 















 



 





 






 








 





















 



 

extern int __fcntl (int __fd, int __cmd,...)	;

 


extern int __open (__const char *__file, int __oflag,...)	;




 


extern int creat (__const char *__file, __mode_t __mode)	;










 


# 26 "/usr1/gnu/DIST/hurd/include/sys/file.h" 2 3



 





 




 



 

extern int __flock (int __fd, int __operation)	;

 


 


# 34 "ufs_fsops.c" 2




# 1 "../hurd/paths.h" 1 3
 





















 









 




 





 










# 38 "ufs_fsops.c" 2

# 1 "/usr1/gnu/DIST/hurd/include/string.h" 1 3
 

















 








 

 


# 1 "/usr1/gnu/DIST/hurd/include/stddef.h" 1 3



 









 


 





 

 

# 57 "/usr1/gnu/DIST/hurd/include/stddef.h" 3


 

 


# 91 "/usr1/gnu/DIST/hurd/include/stddef.h" 3





 




 

# 137 "/usr1/gnu/DIST/hurd/include/stddef.h" 3




 
















# 33 "/usr1/gnu/DIST/hurd/include/string.h" 2 3



 
extern void *  memcpy (void *  __dest, __const void *  __src,
			    size_t __n)	;
 

extern void *  memmove (void *  __dest, __const void *  __src,
			     size_t __n)	;

 


extern void *  __memccpy (void *  __dest, __const void *  __src,
			       int __c, size_t __n)	;

extern void *  memccpy (void *  __dest, __const void *  __src,
			     int __c, size_t __n)	;






 
extern void *  memset (void *  __s, int __c, size_t __n)	;

 
extern int memcmp (__const void *  __s1, __const void *  __s2,
			size_t __n)	;

 
extern void *  memchr (__const void *  __s, int __c, size_t __n)	;


 
extern char *strcpy (char *__dest, __const char *__src)	;
 
extern char *strncpy (char *__dest, __const char *__src, size_t __n)	;

 
extern char *strcat (char *__src, __const char *__dest)	;
 
extern char *strncat (char *__dest, __const char *__src, size_t __n)	;

 
extern int strcmp (__const char *__s1, __const char *__s2)	;
 
extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)	;

 
extern int strcoll (__const char *__s1, __const char *__s2)	;
 
extern size_t strxfrm (char *__dest, __const char *__src, size_t __n)	;


 
extern char *strdup (__const char *__s)	;


 
extern char *strchr (__const char *__s, int __c)	;
 
extern char *strrchr (__const char *__s, int __c)	;

 

extern size_t strcspn (__const char *__s, __const char *__reject)	;
 

extern size_t strspn (__const char *__s, __const char *__accept)	;
 
extern char *strpbrk (__const char *__s, __const char *__accept)	;
 
extern char *strstr (__const char *__haystack, __const char *__needle)	;
 
extern char *strtok (char *__s, __const char *__delim)	;


 


extern void *  memmem (__const void *  __needle, size_t __needlelen,
			    __const void *  __haystack, size_t __haystacklen)	;


 
extern size_t strlen (__const char *__s)	;

 
extern char *strerror (int __errnum)	;


 
extern char *index (__const char *__s, int __c)	;

 
extern char *rindex (__const char *__s, int __c)	;

 
extern void bcopy (__const void *  __src, void *  __dest, size_t __n)	;

 
extern void bzero (void *  __s, size_t __n)	;

 
extern int bcmp (__const void *  __s1, __const void *  __s2, size_t __n)	;

 

extern int ffs (int __i)	;





 
extern int strcasecmp (__const char *__s1, __const char *__s2)	;

 

extern char *strsep (char **__stringp, __const char *__delim)	;



 
extern int strncasecmp (__const char *__s1, __const char *__s2,
			     size_t __n)	;

 
extern char *strsignal (int __sig)	;

 
extern char *stpcpy (char *__dest, __const char *__src)	;

 
extern char *strfry (char *__string)	;

 
extern void *  memfrob (void *  __s, size_t __n)	;


 


# 39 "ufs_fsops.c" 2

# 1 "/usr1/gnu/DIST/hurd/include/stdio.h" 1 3
 

















 









 



# 1 "/usr1/gnu/DIST/hurd/include/stddef.h" 1 3



 









 


 





 

 

# 57 "/usr1/gnu/DIST/hurd/include/stddef.h" 3


 

 


# 91 "/usr1/gnu/DIST/hurd/include/stddef.h" 3





 




 

# 137 "/usr1/gnu/DIST/hurd/include/stddef.h" 3




 
















# 33 "/usr1/gnu/DIST/hurd/include/stdio.h" 2 3



# 1 "/usr1/gnu/DIST/hurd/include/stdarg.h" 1 3
 




































 






typedef void *__gnuc_va_list;



 

# 70 "/usr1/gnu/DIST/hurd/include/stdarg.h" 3










# 105 "/usr1/gnu/DIST/hurd/include/stdarg.h" 3




# 36 "/usr1/gnu/DIST/hurd/include/stdio.h" 2 3












 
typedef struct __stdio_file FILE;







 
typedef __off_t fpos_t;

 
typedef struct
{
  unsigned int __read:1;	 
  unsigned int __write:1;	 
  unsigned int __append:1;	 
  unsigned int __binary:1;	 
  unsigned int __create:1;	 
  unsigned int __exclusive:1;	 
  unsigned int __truncate:1;	 
} __io_mode;


 

 

typedef __ssize_t __io_read (void *  __cookie, char *__buf,
				  size_t __nbytes)	;

 





typedef __ssize_t __io_write (void *  __cookie, __const char *__buf,
				   size_t __n)	;

 





typedef int __io_seek (void *  __cookie, fpos_t * __pos, int __w)	;

 
typedef int __io_close (void *  __cookie)	;

 
typedef struct
{
  __io_read *__read;		 
  __io_write *__write;		 
  __io_seek *__seek;		 
  __io_close *__close;		 
} __io_functions;

 
typedef struct
{
   
  int (*__input) (FILE * __stream)	;
   
  void (*__output) (FILE * __stream, int __c)	;
} __room_functions;

extern __const __io_functions __default_io_functions;
extern __const __room_functions __default_room_functions;


 
extern __io_close __stdio_close;
 
extern void *  __stdio_open (__const char *__file, __io_mode __m,
				  int *__dp)	;
 
extern void __stdio_errmsg (__const char *__msg, size_t __len)	;
 
extern char *__stdio_gen_tempname (__const char *__dir,
					__const char *__pfx,
					int __dir_search, size_t * __lenptr)	;









 
extern __volatile  void __libc_fatal (__const char *__message)	;


 
struct __stdio_file
{
   

  int __magic;



  char *__bufp;			 
  char *__get_limit;		 
  char *__put_limit;		 
  char *__buffer;		 
  size_t __bufsize;		 
  FILE *__next;			 
  void *  __cookie;		 
  int __fileno;			 
  unsigned char __pushback;	 
  char *__pushback_bufp;	 
  unsigned int __pushed_back:1;	 
  unsigned int __eof:1;		 
  unsigned int __error:1;	 
  unsigned int __userbuf:1;	 
  unsigned int __linebuf:1;	 
  unsigned int __seen:1;	 
  unsigned int __ispipe:1;	 
  __io_mode __mode;		 
  __io_functions __io_funcs;	 
  __room_functions __room_funcs; 
  fpos_t __offset;		 
  fpos_t __target;		 
};


 



 







 


 
extern void __invalidate (FILE * __stream)	;

 


extern int __stdio_check_offset (FILE * __stream)	;


 





 



 




 







 




 








# 1 "/usr1/gnu/DIST/hurd/include/stdio_lim.h" 1 3






# 241 "/usr1/gnu/DIST/hurd/include/stdio.h" 2 3



 

extern FILE *__stdio_head;	 

 
extern FILE *stdin, *stdout, *stderr;


 
extern int remove (__const char *__filename)	;
 
extern int rename (__const char *__old, __const char *__new)	;


 
extern FILE *tmpfile (void)	;
 
extern char *tmpnam (char *__s)	;



 






extern char *tempnam (__const char *__dir, __const char *__pfx)	;



 

extern int __flshfp (FILE * __stream, int __c)	;


 
extern int fclose (FILE * __stream)	;
 
extern int fflush (FILE * __stream)	;


 
extern FILE *fopen (__const char *__filename, __const char *__modes)	;
 
extern FILE *freopen (__const char *__filename,
			   __const char *__modes, FILE * __stream)	;

 








extern FILE *__newstream (void)	;


 
extern FILE *fdopen (int __fd, __const char *__modes)	;



 

extern FILE *fopencookie (void *  __magic_cookie, __const char *__modes,
			       __io_functions __io_functions)	;

 
extern FILE *fmemopen (void *  __s, size_t __len, __const char *__modes)	;

 


extern FILE *open_memstream (char **__bufloc, size_t * sizeloc)	;



 

extern void setbuf (FILE * __stream, char *__buf)	;
 


extern int setvbuf (FILE * __stream, char *__buf,
			 int __modes, size_t __n)	;


 

extern void setbuffer (FILE * __stream, char *__buf, size_t __size)	;

 
extern void setlinebuf (FILE * __stream)	;



 
extern int fprintf (FILE * __stream, __const char *__format, ...)	;
 
extern int printf (__const char *__format, ...)	;
 
extern int sprintf (char *__s, __const char *__format, ...)	;

 
extern int vfprintf (FILE * __s, __const char *__format,
			  __gnuc_va_list __arg)	;
 
extern int vprintf (__const char *__format, void *  __arg)	;
 
extern int vsprintf (char *__s, __const char *__format,
			  __gnuc_va_list __arg)	;






 
extern int snprintf (char *__s, size_t __maxlen,
			  __const char *__format, ...)	;

extern int vsnprintf (char *__s, size_t __maxlen,
			   __const char *__format, __gnuc_va_list __arg)	;

 

extern int vasprintf (char **__ptr, __const char *__f,
			   __gnuc_va_list __arg)	;
extern int asprintf (char **__ptr, __const char *__fmt, ...)	;

 
extern int vdprintf (int __fd, __const char *__fmt,
			  __gnuc_va_list __arg)	;
extern int dprintf (int __fd, __const char *__fmt, ...)	;



 
extern int fscanf (FILE * __stream, __const char *__format, ...)	;
 
extern int scanf (__const char *__format, ...)	;
 
extern int sscanf (__const char *__s, __const char *__format, ...)	;


 
extern int __vfscanf (FILE * __s, __const char *__format,
			   __gnuc_va_list __arg)	;
extern int vfscanf (FILE * __s, __const char *__format,
			 __gnuc_va_list __arg)	;

 
extern int vscanf (__const char *__format, __gnuc_va_list __arg)	;

 
extern int __vsscanf (__const char *__s, __const char *__format,
			   __gnuc_va_list __arg)	;
extern int vsscanf (__const char *__s, __const char *__format,
			 __gnuc_va_list __arg)	;










 

extern int __fillbf (FILE * __stream)	;


 
extern int fgetc (FILE * __stream)	;
extern int getc (FILE * __stream)	;

 
extern int getchar (void)	;

 





 








 
extern int fputc (int __c, FILE * __stream)	;
extern int putc (int __c, FILE * __stream)	;

 
extern int putchar (int __c)	;

 









 









 
extern int getw (FILE * __stream)	;

 
extern int putw (int __w, FILE * __stream)	;



 
extern char *fgets (char *__s, size_t __n, FILE * __stream)	;

 

extern char *gets (char *__s)	;





 




__ssize_t  __getdelim (char **lineptr, size_t * n,
			 int delimiter, FILE * stream)	;
__ssize_t  getdelim (char **lineptr, size_t * n,
		       int delimiter, FILE * stream)	;

 
__ssize_t  __getline (char **lineptr, size_t * n, FILE * stream)	;
__ssize_t  getline (char **lineptr, size_t * n, FILE * stream)	;









 
extern int fputs (__const char *__s, FILE * __stream)	;
 
extern int puts (__const char *__s)	;






 
extern int ungetc (int __c, FILE * __stream)	;


 
extern size_t fread (void *  __ptr, size_t __size,
			  size_t __n, FILE * __stream)	;
 
extern size_t fwrite (__const void *  __ptr, size_t __size,
			   size_t __n, FILE * __s)	;


 
extern int fseek (FILE * __stream, long int __off, int __whence)	;
 
extern long int ftell (FILE * __stream)	;
 
extern void rewind (FILE * __stream)	;

 
extern int fgetpos (FILE * __stream, fpos_t * __pos)	;
 
extern int fsetpos (FILE * __stream, __const fpos_t * __pos)	;


 
extern void clearerr (FILE * __stream)	;
 
extern int feof (FILE * __stream)	;
 
extern int ferror (FILE * __stream)	;







 
extern void perror (__const char *__s)	;


extern int sys_nerr;
extern char *sys_errlist[];


extern int _sys_nerr;
extern char *_sys_errlist[];



 
extern void psignal (int __sig, __const char *__s)	;




 
extern int fileno (__const FILE * __stream)	;


 








 
extern FILE *popen (__const char *__command, __const char *__modes)	;

 
extern int pclose (FILE * __stream)	;




 
extern char *ctermid (char *__s)	;
 
extern char *cuserid (char *__s)	;




struct obstack;			 

 
extern FILE *open_obstack_stream (struct obstack *__obstack)	;

 
extern int obstack_printf (struct obstack *__obstack,
				__const char *__format, ...)	;
extern int obstack_vprintf (struct obstack *__obstack,
				 __const char *__format,
				 __gnuc_va_list __args)	;



 




# 40 "ufs_fsops.c" 2


static error_t
create_and_link (struct inode *, char *, __mode_t , struct inode **,
		 struct protid *, struct dirstat *);


 

error_t
file_exec (struct protid *cred,
	   task_t task,
	   int flags,
	   char *argv,
	   __u_int  argvlen,
	   char *envp,
	   __u_int  envplen,
	   mach_port_t *fds,
	   __u_int  fdslen,
	   mach_port_t *portarray,
	   __u_int  portarraylen,
	   int *intarray,
	   __u_int  intarraylen)
{
  return 45 ;
}

 
error_t
do_stat (struct inode *ip,
	 io_statbuf_t *statbuf)
{
  error_t error;
  
  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      statbuf->st_fstype =     0x00000000 ;
      statbuf->st_fsid.val[0] = 0;
      statbuf->st_fsid.val[1] =  0;
      statbuf->st_ino = ip->i_number;
      statbuf->st_gen = ip->di->di_gen;
      statbuf->st_rdev = 0;
      statbuf->st_mode = ((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16)) ;
      statbuf->st_nlink = ip->di->di_nlink;
      statbuf->st_uid = ((ip->di)->di_uidl | ((int)(ip->di)->di_uidh << 16)) ;
      statbuf->st_gid = ((ip->di)->di_gidl | ((int)(ip->di)->di_gidh << 16)) ;
      statbuf->st_size = ip->di->	di_qsize.val[0] ;
      statbuf->st_atime = ip->di->di_atime;
      statbuf->st_atime_usec = 0;
      statbuf->st_mtime = ip->di->di_mtime;
      statbuf->st_mtime_usec = 0;
      statbuf->st_ctime = ip->di->di_ctime;
      statbuf->st_ctime_usec = 0;
      statbuf->st_blksize = sblock->fs_bsize;
      statbuf->st_blocks = ip->di->di_blocks;
      statbuf->st_author = ip->di->di_author;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  return error;
}  


# 126 "ufs_fsops.c"

 

error_t
file_chown (struct protid *cred,
	    __uid_t  uid,
	    __gid_t  gid)
{
  ({	error_t err;	struct inode *ip;	if (!(cred))	return 45 ;	if (readonly)	return 30 ;	ip = (cred)->po->ip;	do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;	err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ;	if (!err)	{	(
		   ({
		     if (!isowner (ip, cred)
			 || ((!isuid (uid, cred)
			      || !groupmember (gid, cred))
			     && !isuid (0, cred)))
		       err = 1 ;
		     else
		       {
			 ip->di->di_uidh = uid >> 16;
			 ip->di->di_uidl = uid & 0xffff;
			 ip->di->di_gidh = gid >> 16;
			 ip->di->di_gidl = gid & 0xffff;
			 ip->di->di_ctime = time->seconds;
		       }
		   }));	(void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;	inode_update (ip, 0);	}	do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;	return err;	}) ;
}

 
error_t
file_chauthor (struct protid *cred,
	       __uid_t  author)
{
  ({	error_t err;	struct inode *ip;	if (!(cred))	return 45 ;	if (readonly)	return 30 ;	ip = (cred)->po->ip;	do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;	err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ;	if (!err)	{	(
		   ({
		     if (!(err = isowner (ip, cred)))
		       {
			 ip->di->di_author = author;
			 ip->di->di_ctime = time->seconds;
		       }
		   }));	(void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;	inode_update (ip, 0);	}	do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;	return err;	}) ;
}

error_t
file_chmod (struct protid *cred,
	    __mode_t  mode)
{
  mode &= ~(	000000170000  | 	037770000000 );
  
  ({	error_t err;	struct inode *ip;	if (!(cred))	return 45 ;	if (readonly)	return 30 ;	ip = (cred)->po->ip;	do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;	err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ;	if (!err)	{	(
		   ({
		     if (!(err = isowner (ip, cred)))
		       {
			 if (!isuid (0, cred))
			   {
			     if ((((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & 	000000170000 ) != 	000000040000 )
			       mode &= ~	000000001000 ;
			     if (!groupmember (((ip->di)->di_gidl | ((int)(ip->di)->di_gidh << 16)) , cred))
			       mode &= ~	000000002000 ;
			     if (!isuid (((ip->di)->di_uidl | ((int)(ip->di)->di_uidh << 16)) , cred))
			       mode &= ~	000000004000 ;
			   }
			 mode |= ((((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & (	000000170000  | 	037770000000 )));
			 ip->di->di_model = mode & 0xffff;
			 ip->di->di_modeh = mode >> 16;
			 ip->di->di_ctime = time->seconds;
		       }
		   }));	(void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;	inode_update (ip, 0);	}	do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;	return err;	}) ;
}

error_t
file_chflags (struct protid *cred,
	      int flags)
{
  ({	error_t err;	struct inode *ip;	if (!(cred))	return 45 ;	if (readonly)	return 30 ;	ip = (cred)->po->ip;	do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;	err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ;	if (!err)	{	(
		   ({
		     if (!(err = isowner (ip, cred)))
		       {
			 ip->di->di_flags = flags;
			 ip->di->di_ctime = time->seconds;
		       }
		   }));	(void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;	inode_update (ip, 0);	}	do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;	return err;	}) ;
}

error_t
file_utimes (struct protid *cred,
	     time_value_t atime,
	     time_value_t mtime)
{
  ({	error_t err;	struct inode *ip;	if (!(cred))	return 45 ;	if (readonly)	return 30 ;	ip = (cred)->po->ip;	do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;	err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ;	if (!err)	{	(
		   ({
		     if (!(err = isowner (ip, cred)))
		       {
			 ip->di->di_atime = atime.seconds;
			 ip->di->di_mtime = mtime.seconds;
			 ip->di->di_ctime = time->seconds;
		       }
		   }));	(void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;	inode_update (ip, 0);	}	do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;	return err;	}) ;
}


error_t
file_seek (struct protid *cred,
	   int offset,
	   int whence,
	   int *newoffset)
{
   

  


  ({	error_t err;	struct inode *ip;	if (!(cred))	return 45 ;	if (0 )	return 30 ;	ip = (cred)->po->ip;	do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;	err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ;	if (!err)	{	(
		   ({
		     if (!(err = fs_get_it (ip)))
		       switch (whence)
			 {
			 case 0	:
			   cred->po->filepointer = offset;
			   break;
			 case 1	:
			   cred->po->filepointer += offset;
			   break;
			 case 2	:
			   cred->po->filepointer = ip->di->	di_qsize.val[0]  + offset;
			   break;
			 default:
			   err = 22 ;
			   break;
			 }
		     *newoffset = cred->po->filepointer;
		   }));	(void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;	inode_update (ip, 0);	}	do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;	return err;	}) ;

}

error_t
file_truncate (struct protid *cred,
	       int size)
{
  ({	error_t err;	struct inode *ip;	if (!(cred))	return 45 ;	if (readonly)	return 30 ;	ip = (cred)->po->ip;	do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;	err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ;	if (!err)	{	(
		   ({
		     if (!(cred->po->openstat &    0x00000002 ))
		       err = 22 ;
		     else
		       inode_truncate (ip, size);
		   }));	(void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;	inode_update (ip, 0);	}	do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;	return err;	}) ;
}

 
error_t
file_lock (struct protid *cred,
	   int flags)
{
  struct inode *ip;
  struct peropen *po;
  
  if (!cred)
    return 45 ;
  
  po = cred->po;
  ip = cred->po->ip;
  if (!(flags & (8    	|2    	|1    	)))
    return 0;
  
  if ((flags & 8    	)
      && (flags & (1    	|2    	)))
    return 22 ;

  if (flags & 2    	)
    flags &= ~1    	;

  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;
  if (flags & 8    	)
    {
      if (po->flock_status == 8    	)
	{
	  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;
	  return 9 ;
	}
      if (po->flock_status != ip->flock_type)
	panic ("flock");
      
      if (po->flock_status == 1    	)
	{
	  if (!--ip->shlock_count)
	    ip->flock_type = 8    	;
	}
      else if (po->flock_status == 2    	)
	ip->flock_type = 8    	;
      else
	panic ("flock 2");

      if (ip->flock_type == 8    	 && ip->needflock)
	{
	  ip->needflock = 0;
	  	do { if ((&ip->i_flockwait)->queue.head) cond_broadcast(&ip->i_flockwait); } while (0) ;
	}
      po->flock_status = 8    	;
    }
  else
    {
       
      if (po->flock_status == 2    	)
	{
	  po->flock_status = 8    	;
	  ip->flock_type = 8    	;
	  if (ip->needflock)
	    {
	      ip->needflock = 0;
	      	do { if ((&ip->i_flockwait)->queue.head) cond_broadcast(&ip->i_flockwait); } while (0) ;
	    }
	}
	  
       
      while (ip->flock_type == 2    	)
	{
	  if (flags & 4    	)
	    {
	      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;
	      return 35 ;
	    }
	  else
	    {
	      ip->needflock = 1;
	      condition_wait (&ip->i_flockwait, &ip->i_toplock);
	    }
	}

       
      if (po->flock_status == 1    	)
	{
	  po->flock_status = 8    	;
	  if (!--ip->shlock_count)
	    {
	      ip->flock_type = 8    	;
	      if (ip->needflock)
		{
		  ip->needflock = 0;
		  	do { if ((&ip->i_flockwait)->queue.head) cond_broadcast(&ip->i_flockwait); } while (0) ;
		}
	    }
	}
      
      if (flags & 1    	)
	{
	  if (ip->flock_type == 2    	)
	    panic ("flock 3");

	  po->flock_status = 1    	;
	  ip->flock_type = 1    	;
	  ip->shlock_count++;
	}
      else if (flags & 2    	)
	{
	   
	  while (ip->flock_type == 1    	)
	    {
	      if (flags & 4    	)
		{
		  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;
		  return 35 ;
		}
	      else
		{
		  ip->needflock = 1;
		  condition_wait (&ip->i_flockwait, &ip->i_toplock);
		}
	    }	

	  if (ip->flock_type == 2    	)
	    panic ("flock 4");
	  
	  ip->flock_type = 2    	;
	  po->flock_status = 2    	;
	}
      else
	panic ("flock 5");
    }
  return 0;
}

 

error_t
file_lock_stat (struct protid *cred,
		int *mystat,
		int *allstat)
{
  struct inode *ip;
  
  if (!cred)
    return 45 ;
  ip = cred->po->ip;
  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;
  *mystat = cred->po->flock_status;
  *allstat = ip->flock_type;
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;
  return 0;
}


 
error_t
file_getcontrol (struct protid *cred,
		 mach_port_t *control)
{
  int error = 0;;

  if (!cred)
    return 45 ;
  
  if (!isuid (0, cred))
    error = 1 ;
  else
    *control = ufs_control_port;

  return error;
}

 
error_t
file_statfs (struct protid *file,
	     fsys_statfsbuf_t *statbuf)
{
  if (!file)
    return 45 ;
  
  statbuf->fsys_stb_type =     0x00000000 ;
  statbuf->fsys_stb_bsize = sblock->fs_bsize;
  statbuf->fsys_stb_fsize = sblock->fs_fsize;
  statbuf->fsys_stb_blocks = sblock->fs_dsize;
  statbuf->fsys_stb_bfree = sblock->fs_cstotal.cs_nbfree
    * sblock->fs_frag + sblock ->fs_cstotal.cs_nffree;
  statbuf->fsys_stb_bavail
    = (sblock->fs_dsize * (100 - sblock->fs_minfree) / 100) 
      - (sblock->fs_dsize - statbuf->fsys_stb_bfree);
  statbuf->fsys_stb_files = sblock->fs_ncg * sblock->fs_ipg - 	((__ino_t )2)	;
  statbuf->fsys_stb_ffree = sblock->fs_cstotal.cs_nifree;
  statbuf->fsys_stb_fsid_1 = 0;
  statbuf->fsys_stb_fsid_2 =  0;

  return 0;
}

 

error_t
file_sync (struct protid *cred,
	   int wait)
{
  struct inode *ip;

  if (!cred)
    return 45 ;
  
  ip = cred->po->ip;
  
  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;
  fs_get_it (ip);
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;
  file_update (ip, wait);
  return 0;
}

 



error_t
file_syncfs (struct protid *cred,
	     int wait,
	     int dochildren)	 
{
  if (!cred)
    return 45 ;
  
  sync_everything (wait);
  return 0;
}

 
error_t
file_pathconf (struct protid *cred,
	       struct pathconf *conf)
{
  if (!cred)
    return 45 ;
  
  conf->link_max = 32767 ;
  conf->max_canon = 0;
  conf->max_input = 0;
  conf->name_max = 255 ;
  conf->path_max = -1;
  conf->pipe_buf = -1;
  conf->_posix_chown_restricted = 1;
  conf->_posix_no_trunc = 1;
  conf->_posix_vdisable = -1;
  return 0;
}

 
error_t
file_getlinknode (struct protid *cred,
		  struct protid **newport)
{
  struct inode *ip;

  if (!cred)
    return 45 ;
  
  ip = cred->po->ip;
  if (ip->i_number == 	((__ino_t )2)	)
    return 16 ;
  
  *newport = cred;
  return 0;
}

error_t
file_getfh (struct protid *cred,
	    char **data,
	    __u_int  *datalen)
{
  return 45 ;
}




 
error_t
dir_pathtrans (struct protid *dircred,
	       char *path,
	       int flags,
	       __mode_t  mode,
	       enum retry_type *retry,
	       char *retryname,
	       struct protid **result)
{
  struct inode *__volatile  dip;
  struct inode *ip;
  __volatile  int nsymlink = 0;
  char *__volatile  nextname;
  int nextnamelen;
  int error = 0;
  char *__volatile  pathbuf;
  int pathbuflen = 0;
  int newnamelen;
  int create, excl;
  __volatile  int lastcomp = 0;
  __volatile  int newnode = 0;
  struct dirstat ds;

  if (!dircred)
    return 45 ;
  
  create = (flags &   0x00000020 );
  excl = (flags &     0x00000080 );
  
   
  if (path[0] == '/')
    return 22 ;

  dip = dircred->po->ip;
  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&dip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&dip->i_toplock); } while (0) ;
  ip = 0;
  *retry = FS_RETRY_NONE;

  dip->i_refcnt++;		 

  do
    {
      if (lastcomp)
	panic ("pathtrans: multiple final components?");

      nextname = index (path, '/');

      if (nextname)
	{
	  *nextname++ = '\0';
	  lastcomp = 0;
	}
      else
	lastcomp = 1;
	  
      ip = 0;

      if (lastcomp && create)
	error = lookup (dip, path, CREATE, &ip, &ds, dircred);
      else
	error = lookup (dip, path, LOOKUP, &ip, 0, dircred);

      if (lastcomp && create && excl && (!error || error == 11 ))
	error = 17 ;

      if (error == 11 )
	{
	  *retry = FS_RETRY_REAUTH;
	  *result = 0;		 
	  strcpy (retryname, nextname);
	  error = 0;
	  goto out;
	}

      if (lastcomp && create && error == 2 )
	{
	  mode &= ~(	000000170000  | 	037770000000  | 	000000001000 );
	  mode |= 	000000100000 ;
	  error = create_and_link (dip, path, mode, &ip, dircred, &ds);
	  newnode = 1;
	}
      
      if (error)
	goto out;

      if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
	{
	  if (error)
	    {
	      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	      goto out;
	    }

	  switch (((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & 	000000170000 )
	    {
	    default:
	      panic ("unknown open format");
	      
	    case 	000000100000 :
	    case 	000000040000 :
	    case 	000000140000 :
	    case 	000000010000 :
	    case 	000000020000 :
	    case 	000000060000 :
	      path = nextname;
	      if (ip == dip)
		irele (dip);
	      else
		iput (dip);
	      if (!lastcomp)
		{
		  dip = ip;
		  ip = 0;
		}
	      break;
	      
	    case 	000000120000 :
	      if (nsymlink++ > 32 )
		{
		  error = 62 ;
		  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
		  goto out;
		}
	      
# 686 "ufs_fsops.c"

	      nextnamelen = strlen (nextname);
	      newnamelen = nextnamelen + ip->di->	di_qsize.val[0]  + 2;
	      if (pathbuflen < newnamelen)
		{
		  pathbuf = __builtin_alloca(newnamelen)  ;
		  pathbuflen = newnamelen;
		}
	      
	      error = fs_rdwr (ip, pathbuf + nextnamelen + 1, 
			       0, ip->di->	di_qsize.val[0] , 0, dircred);
	      if (error)
		goto out;
	      
	      if (pathbuf[nextnamelen + 1] == '/')
		{
		   
		  *retry = FS_RETRY_NORMAL;
		  *result = 	((mach_port_t) 0) ;
		  pathbuf[nextnamelen + ip->di->	di_qsize.val[0]  + 1] = '\0';
		  strcpy (retryname, pathbuf + nextnamelen + 1);
		  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
		  goto out;
		}
	      
	      bcopy (pathbuf, nextname, nextnamelen);
	      pathbuf[nextnamelen] = '/';
	      
	      path = pathbuf;
	      iput (ip);
	      ip = 0;
	      break;
	    }
	  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	}
      else
	 
	goto out;  
    } while (path && *path);
  
  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      if (!newnode)		 
	{
	  int type = ((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & 	000000170000 ;
	  if ((type == 	000000140000  || type == 	000000060000  
	       || type == 	000000020000  || type == 	000000010000 )
	      && (flags & (    0x00000001 |   0x00000002 |    0x00000004 )))
	    {
	      error = 45 ;
	      goto out1;
	    }
	  if (flags &     0x00000001 )
	    {
	      if (error = ufs_access (ip, 	0400		, dircred))
		goto out1;
	    }
	  
	  if (flags &     0x00000004 )
	    {
	      if (error = ufs_access (ip, 	0100 , dircred))
		goto out1;
	    }
	  
	  if (flags & (   0x00000002 |0x00000040 ))
	    {
	      if (type == 	000000040000 )
		{
		  error = 21 ;
		  goto out1;
		}
	      if (readonly)
		{
		  error = 30 ;
		  goto out1;
		}
	      if (error = ufs_access (ip, 	0200 , dircred))
		goto out1;
	    }
	}
      
      if (flags & 0x00000040 )
	inode_truncate (ip, 0);
      
      flags &= 0x00000017 ;
      
      printf ("ip: 0x%x\n", (int)ip);
      *result = make_protid (ip, flags, dircred);
    out1:
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }

 out:
  if (ip)
    {
      if (dip == ip)
	irele (ip);
      else
	iput (ip);
    }
  if (dip)
    iput (dip);
  if (ds.type != LOOKUP)
    dsrelease (&ds);
  return error;
}

error_t 
dir_readdir (struct protid *dircred,
	     char **data,
	     unsigned int *datalen,
	     int offset,
	     int *newoffset,
	     int maxread)
{
  error_t err;
  
  if (offset == -1)
    return 22 ;
  
  err = io_read (dircred, data, datalen, offset, maxread);
  
  if (!err)
    *newoffset = offset + *datalen;
  
  return err;
}

error_t
dir_mkdir (struct protid *dircred,
	   char *name,
	   __mode_t  mode)
{
  struct inode *dip;
  struct inode *ip = 0;
  struct dirstat ds;
  int error;

  if (!dircred)
    return 45 ;
  
  dip = dircred->po->ip;
  if (readonly)
    return 30 ;

  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&dip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&dip->i_toplock); } while (0) ;

  error = lookup (dip, name, CREATE, 0, &ds, dircred);

  if (error == 11 )
    error = 17 ;
  if (!error)
    error =  17 ;
  if (error != 2 )
    {
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
      return error;
    }

  mode &= ~(	037770000000  | 	000000170000 );
  mode |= 	000000040000 ;

  error = create_and_link (dip, name, mode, &ip, dircred, &ds);

  if (!error)
    iput (ip);

  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
  return error;
}

 


static error_t
clear_directory (struct inode *dp,
		 struct inode *pdp,
		 struct protid *cred)
{
  error_t err;
  struct dirstat ds;
  struct inode *ip;
  
   
  err = lookup (dp, ".", REMOVE, &ip, &ds, cred);
  if (err == 2 )
    panic ("clear_directory no `.' entry");
  if (!err)
    err = dirremove (dp, &ds);
  if (err)
    return err;
  
   
  if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      dp->di->di_nlink--;
      dp->di->di_ctime = time->seconds;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  else
    return err;

   
  err = ufs_checkdirmod (dp, ((dp->di)->di_model | ((int)(dp->di)->di_modeh << 16)) , pdp, cred);
  if (!err)
    err = lookup (dp, "..", REMOVE | 0x10000000	, &ip, &ds, cred);
  if (err == 2 )
    panic ("clear_directory no `..' entry");
  if (!err)
    err = dirremove (dp, &ds);
  if (err)
    return err;
  
   
  if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      pdp->di->di_nlink--;
      pdp->di->di_ctime = time->seconds;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  else
    return err;
  return err;
}


error_t
dir_rmdir (struct protid *dircred,
	   char *name)
{
  struct inode *dip;
  struct inode *ip = 0;
  struct dirstat ds;
  error_t error;

  if (!dircred)
    return 45 ;
  
  dip = dircred->po->ip;
  if (readonly)
    return 30 ;

  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&dip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&dip->i_toplock); } while (0) ;

  error = lookup (dip, name, REMOVE, &ip, &ds, dircred);
  if (error = 11 )
    error = 66 ;
  if (error)
    {
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
      return error;
    }

   
  if (dip == ip)
    {
      irele (ip);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
      dsrelease (&ds);
      return 22 ;
    }

   


  if (!dirempty (ip, dircred))
    {
      iput (ip);
      dsrelease (&ds);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
      return 66 ;
    }

  if (error = dirremove (dip, &ds))
    {
      iput (ip);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
      return error;
    }

  clear_directory (ip, dip, dircred);
  iput (ip);
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
  return 0;
}

error_t
dir_unlink (struct protid *dircred,
	    char *name)
{
  struct inode *dip;
  struct inode *ip;
  struct dirstat ds;
  error_t error;

  if (!dircred)
    return 45 ;
  
  dip = dircred->po->ip;
  if (readonly)
    return 30 ;

  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&dip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&dip->i_toplock); } while (0) ;

  error = lookup (dip, name, REMOVE, &ip, &ds, dircred);
  if (error == 11 )
    error = 21 ;
  if (error)
    {
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
      return error;
    }
  
  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
       

      if ((((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & 	000000170000 ) == 	000000040000 )
	{
	  if (ip == dip)		 
	    irele (ip);
	  else
	    iput (ip);
	  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
	  dsrelease (&ds);
	  return 21 ;
	}
      else
	{  
	  error = dirremove (dip, &ds);
	  if (!error)
	    {
	      ip->di->di_nlink--;
	      ip->di->di_ctime = time->seconds;
	    }
	  else
	    {
	      iput (ip);
	      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
	      return error;
	    }
	}
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }

   

  if (ip == dip)
    irele (ip);	
  else
    iput (ip);
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
  return error;
}

error_t
dir_link (struct protid *filecred,
	  struct protid *dircred,
	  char *name)
{
  struct inode *ip;
  struct inode *dip;
  struct dirstat ds;
  error_t error;

  if (!filecred)
    return 45 ;
  
  ip = filecred->po->ip;
  if (readonly)
    return 30 ;
  
  if (!dircred)
    return 18 ;
  
  dip = dircred->po->ip;
  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&dip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&dip->i_toplock); } while (0) ;
   
  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&ip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&ip->i_toplock); } while (0) ;

  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      if ((((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & 	000000170000 ) == 	000000040000 )
	error = 21 ;
      else if (ip->di->di_nlink == 32767  - 1)
	error = 31 ;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  if (error)
    return error;

  ds.type = LOOKUP;

  error = lookup (dip, name, CREATE, 0, &ds, dircred);

  if (error == 11 )
    error = 17 ;
  if (!error)
    error = 17 ;
  if (error != 2 )
    goto out;
  
  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      ip->di->di_nlink++;
      ip->di->di_ctime = time->seconds;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  else
    goto out;
  
  inode_update (ip, 1);

  error =  direnter (dip, name, ip, &ds, dircred);
  if (error)
    {
      if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
	{
	  ip->di->di_nlink--;
	  ip->di->di_ctime = time->seconds;
	  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	}
    }

 out:
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&dip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&dip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&dip->i_toplock); } while (0) ;
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&ip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&ip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&ip->i_toplock); } while (0) ;
  return error;
}

 


static struct mutex renamedirlock;
static int renamedirinit;

error_t
dir_rename (struct protid *fromcred,
	    char *fromname,
	    struct protid *tocred,
	    char *toname)
{
  struct inode *fdp, *tdp, *fip, *tip, *tmpip;
  error_t err;
  int isdir;
  struct dirstat ds;
  

  if (!fromcred)
    return 45 ;

   
  if (!tocred)
    return 18 ;

  if (readonly)
    return 30 ;

  fdp = fromcred->po->ip;
  tdp = tocred->po->ip;

 try_again:
   


  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&fdp->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&fdp->i_toplock); } while (0) ;
  err = lookup (fdp, fromname, LOOKUP, &fip, 0, fromcred);
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&fdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&fdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&fdp->i_toplock); } while (0) ;
  if (err)
    return err;

  if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    isdir = (((fip->di)->di_model | ((int)(fip->di)->di_modeh << 16))  & 	000000170000 ) == 	000000040000 ;
  else
    {
      iput (fip);
      return err;
    }

  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&fip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&fip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&fip->i_toplock); } while (0) ;

  if (isdir)
    {
       


      if (!renamedirinit)
	{
	  	do {(*(&(&renamedirlock)->lock) = 0) ; ((&(&renamedirlock)->queue)->head = (&(&renamedirlock)->queue)->tail = 0) ; (*(&(&renamedirlock)->held) = 0) ;} while (0) ;
	  renamedirinit++;
	}
      if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&renamedirlock)->held)) ); !_r__; })  )
	{
	  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&renamedirlock)->held)) ); !_r__; }) ) mutex_lock_solid(&renamedirlock); } while (0) ;
	  goto try_again;
	}
    }

  if (isdir)
    {
       

      do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&tdp->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&tdp->i_toplock); } while (0) ;
      err = checkpath (fip, tdp, tocred);
      if (err)
	{
	  irele (fip);
	  return err;
	}
    }
  
   
  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&tdp->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&tdp->i_toplock); } while (0) ;
  
  err = lookup (tdp, toname, RENAME, &tip, &ds, tocred);
  if (err && err != 2 )
    {
      irele (fip);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
      return err;
    }

  if (tip == fip)
    {
      irele (fip);
      iput (tip);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
      return 0;
    }

   


  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&fip->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&fip->i_toplock); } while (0) ;
  if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      if (isdir && tip)
	{
	  if ((((tip->di)->di_model | ((int)(tip->di)->di_modeh << 16))  & 	000000170000 ) != 	000000040000 )
	    {
	      iput (fip);
	      iput (tip);
	      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
	      return 20 ;
	    }
	  
	  if (!dirempty (tip, tocred))
	    {
	      iput (fip);
	      iput (tip);
	      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
	      return 66 ;
	    }
	}
      
      if (fip->di->di_nlink == 32767  - 1)
	{
	  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	  iput (fip);
	  if (tip)
	    iput (tip);
	  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
	  return 31 ;
	}
      fip->di->di_nlink++;
      fip->di->di_ctime = time->seconds;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  else
    {
      iput (fip);
      iput (tip);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
      return err;
    }
  if (isdir)
    {
       
      if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
	{
	  if (tdp->di->di_nlink == 32767  - 1)
	    {
	      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	      iput (fip);
	      iput (tip);
	      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
	      return 31 ;
	    }
	  tdp->di->di_nlink++;
	  tdp->di->di_ctime = time->seconds;
	  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	}
      if (!err)
	{
	  struct dirstat tmpds;
	  err = ufs_checkdirmod (fip, ((fip->di)->di_model | ((int)(fip->di)->di_modeh << 16)) , fdp, fromcred);
	  if (!err)
	    err = lookup (fip, "..", RENAME | 0x10000000	, 
			  0, &tmpds, fromcred);
	  if (err == 2 )
	    panic ("rename of directory missing `..'");
	  if (!err)
	    err = dirrewrite (fip, tdp, &tmpds);
	  else
	    dsrelease (&tmpds);
	}
      if (err)
	{
	  iput (fip);
	  iput (tip);
	  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
	  return err;
	}
    }

  inode_update (fip, 1);
	  
  if (tip)
    {
      err = dirrewrite (tdp, fip, &ds);
      if (!err
	  && !(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
	{
	  tip->di->di_nlink--;
	  tip->di->di_ctime = time->seconds;
	  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	}
      if (isdir)
	clear_directory (tip, tdp, tocred);
      iput (tip);
    }
  else
    err = direnter (tdp, toname, fip, &ds, tocred);

  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&tdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&tdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&tdp->i_toplock); } while (0) ;
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&fip->i_toplock)->held)) ); 0; }) ,(( int) ((&(&fip->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&fip->i_toplock); } while (0) ;
  if (err)
    {
      irele (fip);
      return err;
    }

  
   



  do { if (!({  boolean_t _r__; asm __volatile ("movl $1, %0; \n			  xchgl %0, %1" : "=&r" (_r__), "=m" (*(&(&fdp->i_toplock)->held)) ); !_r__; }) ) mutex_lock_solid(&fdp->i_toplock); } while (0) ;
  err = lookup (fdp, fromname, REMOVE, &tmpip, &ds, fromcred);
  if (err)
    {
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&fdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&fdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&fdp->i_toplock); } while (0) ;
      irele (fip);
      return err;
    }

  if (tmpip != fip)
    {
      dsrelease (&ds);
      if (isdir)
	panic ("rename / rmdir collision");
      iput (tmpip);
      irele (fip);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&fdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&fdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&fdp->i_toplock); } while (0) ;
      return 0;
    }
  
  irele (tmpip);

  if (!err)
    err = dirremove (fdp, &ds);
  else
    {
      dsrelease (&ds);
      iput (fip);
      do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&fdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&fdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&fdp->i_toplock); } while (0) ;
      return err;
    }

  if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      fip->di->di_nlink--;
      fip->di->di_ctime = time->seconds;
      if (isdir)
	{
	  fdp->di->di_nlink--;	 
	  fdp->di->di_ctime = time->seconds;
	}
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }

  iput (fip);
  do { if (({  register int _u__ ; asm __volatile ("xorl %0, %0; \n			  xchgl %0, %1" : "=&r" (_u__), "=m" (*(&(&fdp->i_toplock)->held)) ); 0; }) ,(( int) ((&(&fdp->i_toplock)->queue)->head))  != 0)mutex_unlock_solid(&fdp->i_toplock); } while (0) ;
  return err;
}

 



static error_t
create_and_link (struct inode *dir,
		 char *name,
		 __mode_t  mode,
		 struct inode **newnode,
		 struct protid *cred,
		 struct dirstat *ds)
{
  struct inode *ip;
  error_t err;
  __volatile  int dirinc = 0;
  
   
  ialloc (((mode & 	000000170000 ) == 	000000040000 ) ? dirpref () : dir->i_number,
	  mode, newnode);
  ip = *newnode;

   

  if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
       
      ip->di->di_nlink = 1;
      ip->di->di_qsize.val[0] = 0;
      ip->di->di_qsize.val[1] = 0;
      ip->di->di_flags = 0;
      ip->di->di_trans = 0;

       

      if (cred->nuids == 0)
	{
	  ip->di->di_uidl = dir->di->di_uidl;
	  ip->di->di_uidh = dir->di->di_uidh;
	  mode &= ~(	000000004000 );
	}
      else
	{
	  ip->di->di_uidl = (cred->uids->ids[0] & 0xffff);
	  ip->di->di_uidh = (cred->uids->ids[0] & 0xffff0000) >> 16;
	}
      
       


      if (cred->ngids == 0
	  || groupmember (((dir->di)->di_gidl | ((int)(dir->di)->di_gidh << 16)) , cred))
	{
	  ip->di->di_gidl = dir->di->di_gidl;
	  ip->di->di_gidh = dir->di->di_gidh;
	  if (cred->ngids == 0)
	    mode &= ~	000000002000 ;
	}
      else
	{
	  ip->di->di_gidl = (cred->gids->ids[0] & 0xffff);
	  ip->di->di_gidh = (cred->gids->ids[0] & 0xffff0000) >> 16;
	}
      
      ip->di->di_model = (mode & 0xffff);
      ip->di->di_modeh = (mode & 0xffff0000) >> 16;

       
      ip->di->di_atime = ip->di->di_mtime = ip->di->di_ctime = time->seconds;

      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  else
    goto dumpit;

  if ((mode & 	000000170000 ) == 	000000040000 )
    {
      struct dirstat dirds;
      struct inode *foo;

       
      if (!(err = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
	{
	  if (dir->di->di_nlink == 32767  - 1)
	    {
	      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	      err = 31 ;
	      goto dumpit;
	    }
	  ip->di->di_nlink++;	 
	  dir->di->di_nlink++;	 
	  dirinc = 1;
	  ip->di->di_ctime = time->seconds;
	  dir->di->di_ctime = time->seconds;
	  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	}
      else
	goto dumpit;
      
      inode_update (ip, 1);
      inode_update (dir, 1);

       
      
      err = lookup (ip, ".", CREATE, &foo, &dirds, cred);
      if (err != 2 )
	panic ("new directory already contains `.'");
      err = direnter (ip, ".", ip, &dirds, cred);
      if (err)
	goto dumpit;
      
      err = lookup (ip, "..", CREATE, &foo, &dirds, cred);
      if (err != 2 )
	panic ("new directory already contains `..'");
      err = direnter (ip, "..", dir, &dirds, cred);
      if (err)
	goto dumpit;
    }
  else
    inode_update (ip, 1);
  
  err = direnter (dir, name, ip, ds, cred);
  return err;

 dumpit:
  if (!({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) )
    {
      if (dirinc)
	{
	  dir->di->di_nlink--;
	  dir->di->di_ctime = time->seconds;
	}
      ip->di->di_nlink = 0;
      ip->di->di_ctime = time->seconds;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  iput (ip);
  return err;
}

error_t
file_set_translator (struct protid *cred,
		     int flags,
		     int killtrans_flags,
		     char *transname,
		     __u_int  transnamelen,
		     fsys_t existing)
{
  struct inode *ip;
  error_t error;
  __daddr_t  blkno;
  char blkbuf[sblock->fs_fsize];

  if (!cred)
    return 45 ;
  
  ip = cred->po->ip;

  if (error = isowner (ip, cred))
    return error;

  if (ip->i_translator)
    {
      if  (flags &      0x00000002 )
	{
	  iput (ip);
	  return 16 ;
	}
      destroy_translator (ip, killtrans_flags);
    }

  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      if ((flags &      0x00000002 ) && ip->di->di_trans)
	{
	  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	  iput (ip);
	  return 16 ;
	}
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
	  
   
  if (!(flags &     0x00000001 ))
    {
      __volatile  __mode_t  newmode = 0;
      
      if (!strcmp (transname, 	"/hurd/"  "symlink" ))
	newmode = 	000000120000 ;
      else if (!strcmp (transname, 	"/hurd/"  "chrdev" ))
	newmode = 	000000020000 ;
      else if (!strcmp (transname, 	"/hurd/"  "blkdev" ))
	newmode = 	000000060000 ;
      else if (!strcmp (transname, 	"/hurd/"  "fifo" ))
	newmode = 	000000010000 ;
      else if (!strcmp (transname, 	"/hurd/"  "ifsock" ))
	newmode = 	000000140000 ;
      
      if (newmode)
	{
	  __volatile  __dev_t  devno = 0;
	  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
	    {
	      if ((((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & 	000000170000 ) == 	000000040000 )
		{
		   



		  (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
		  iput (ip);
		  return 21 ;
		}
	      if (newmode == 	000000060000  || newmode == 	000000020000 )
		{
		   

		  char buf[20];
		  
		  if ((((ip->di)->di_model | ((int)(ip->di)->di_modeh << 16))  & 	000000170000 ) != 	000000100000 )
		    {
		      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
		      iput (ip);
		      return 22 ;
		    }
		  error = fs_rdwr (ip, buf, 0, 20, 0, 0);
		  if (error)
		    {
		      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
		      iput (ip);
		      return error;
		    }
		  devno = ((int) strtol((buf), (char **) ((void *)0) , 10) ) ;
		}
	      if (newmode != 	000000120000 )
		inode_truncate (ip, 0);
	      ip->di->di_model = (ip->di->di_model & ~	000000170000 ) | newmode;
	      if (newmode == 	000000060000  || newmode == 	000000020000 )
		ip->di->	di_db[0]  = devno;
	      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
	    }
	  inode_update (ip, 1);
	  iput (ip);
	  return 0;
	}
    }

   
  error = alloc (ip, 0, 0, sblock->fs_fsize, &blkno, cred);
  if (error)
    {
      iput (ip);
      return error;
    }
  
   
  strcpy (blkbuf, transname);
  dev_write_sync (blkno, blkbuf, sblock->fs_fsize);
  
   
  if (!(error = ({	struct thread_stuff *tmp;	tmp = __builtin_alloca (sizeof (struct thread_stuff));	tmp->link = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp)) ;	__setjmp (tmp->buf) ;	}) ))
    {
      ip->di->di_trans = blkno;
      (void) ({	struct thread_stuff *tmp;	tmp = (struct thread_stuff *)	((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data) ;	(void) ((	(((* (ur_cthread_t *) ( ((({  int	_sp__; asm("movl %%esp, %0" :	"=g" (_sp__) ); _sp__; }) ) | cthread_stack_mask) + 1 - sizeof(ur_cthread_t *)) ) ) ->incarnation) )->data = ( (any_t)tmp->link)) ;	})	;
    }
  iput (ip);
  return error;
}

error_t
file_get_translator_cntl (struct protid *cred,
			  mach_port_t *ctl)
{
  struct inode *ip;
  error_t error;
  
  if (!cred)
    return 45 ;
  
  ip = cred->po->ip;

  if (!ip->i_translator)
    error = 6 ;
  else
    error = isowner (ip, cred);

  if (!error)
    *ctl = ip->i_translator;

  iput (ip);
  return error;
}

error_t
file_get_translator (struct protid *cred,
		     char **trans,
		     __u_int  *translen)
{
  return 45 ;	 
}
  
void
destroy_translator (struct inode *ip,
		    int flags)
{
  U_fsys_goaway (ip->i_translator, flags);
  mach_port_deallocate (__mach_task_self_ , ip->i_translator);
  ip->i_translator = 0;
}

error_t
file_stat_translator (struct protid *cred,
		      fsys_statfsbuf_t *statbuf)
{
  if (!cred)
    return 45 ;
  
  return file_statfs (cred, statbuf);
}

