⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 attribute.c

📁 虚地址空间基于文件OS内核源代码和文件
💻 C
字号:

#include"../include/os.h"

#define WRONG_FILE_NUMBER	-1
#define WRONG_FILE_STATE	-3
#define WRONG_CAPABILITY	-4
#define WRONG_SEMAPHORE		-5
#define NO_FREE_BLOCK		-6

int query_file_window_attribute(union memory_call_parameter *par)
{
	int fd;
	struct file_window *f;

	fd=par->file_attribute.file_window_id;
	if((fd<0)||(fd>=(*(memory_body->file_number))))
		return WRONG_FILE_NUMBER;
	f=memory_body->file_window+fd;
	if(f->state!=FILE_OPEN)
		return WRONG_FILE_STATE;
	if(!KERNEL_COMPARE_CAPABILITY((f->file.capability),
		(par->file_attribute.capability)))
			return WRONG_CAPABILITY;
	COPY_FILE((f->file),(par->file_attribute.file));
	return 0;
}

int set_file_window_attribute(union memory_call_parameter *par)
{
	int fd;
	struct file_window *f;

	fd=par->file_attribute.file_window_id;
	if((fd<0)||(fd>=(*(memory_body->file_number))))
		return WRONG_FILE_NUMBER;
	f=memory_body->file_window+fd;
	if(f->state!=FILE_OPEN)
		return WRONG_FILE_STATE;
	if(!KERNEL_COMPARE_CAPABILITY((f->file.capability),
		(par->file_attribute.capability)))
			return WRONG_CAPABILITY;
	COPY_FILE((par->file_attribute.file),(f->file));
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -