ERROR: Too many open raster files

A package I am writing using gRASS C functions
gives this error during a d.rast after I have
opened and closed several GRASS raster ifiles for
writing via G_open_cell_* and G_close_cell.
I only have about 6 files in use when the srror ,
sorry - the error occurs.Any ideas?

Joe Mintz, DEpt Computer Science, Birkbeck College