Use safecopy version to get log messages from TTY.

This commit is contained in:
Philip Homburg 2006-07-10 12:42:31 +00:00
parent fd62815e73
commit 9392742cc4
2 changed files with 14 additions and 3 deletions

View file

@ -23,7 +23,7 @@ LIBDRIVER = $d/libdriver/driver.o
all build: $(DRIVER)
$(DRIVER): $(OBJ) $(LIBDRIVER)
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBDRIVER) $(LIBS)
install -S 4kb $(DRIVER)
install -S 8kb $(DRIVER)
$(LIBDRIVER):
cd $d/libdriver && $(MAKE)

View file

@ -32,12 +32,23 @@ message *m; /* notification message */
if (m->m_source == TTY_PROC_NR)
{
cp_grant_id_t gid;
message mess;
gid= cpf_grant_direct(TTY_PROC_NR, (vir_bytes)&kmess, sizeof(kmess),
CPF_WRITE);
if (gid == -1)
{
report("LOG","cpf_grant_direct failed for TTY", errno);
return EDONTREPLY;
}
/* Ask TTY driver for log output */
mess.GETKM_PTR= (char *) &kmess;
mess.m_type = GET_KMESS;
mess.GETKM_GRANT= gid;
mess.m_type = GET_KMESS_S;
r= sendrec(TTY_PROC_NR, &mess);
cpf_revoke(gid);
if (r == OK) r= mess.m_type;
if (r != OK)
{